Yes, it's illegal
You are missing something terribly important:
The package might not be your property [yet]. In any way, it is not in your possession, while it is in the hands of the postal service!
The contents of the package started fully owned by the sender and were entrusted to the postal service to deliver it. This entrustment is (contractually) defined as the time it is handed to the postal service, but the postal service does not gain any ownership. They do however have insurance on the parcel (to some degree), as they are liable for the loss of it. In many cases, the transfer of ownership happens upon delivery (for example, in the UK), so that you can't even be sure you own the contents while the box is still on the truck. At least in the eye of many postal services I know, it is the basic presumption, that they hold the item as entrusted. So to be on the safe side, it's best to presume that the package only becomes your package the moment you sign for the receipt of the package or it is dropped into your mailbox or at your dedicated dropoff point (you can specify that with many postal carriers btw). Otherwise, your actions might interfere with the contract of the mail service [to bring it to your door] and might incur liability upon them as their insurance presumes the parcel was lost and it has to be replaced. By the way, it is customary that any message of the parcel is damaged go to the sender, not the receiver so that in the case of commercial mail they can send/fund a replacement, as the sender needs to ensure that a non-defect item is delivered under their own contract with the recipient.
Criminal lawsuits
But, you want to know which specific law you'd be sued under 18 USC §1708 (2) not only for taking the box, but also for taking the item from the box (emphasis mine)!
Whoever steals, takes, or abstracts, or by fraud or deception obtains, or attempts so to obtain, from or out of any mail, post office, or station thereof, letter box, mail receptacle, or any mail route or other authorized depository for mail matter, or from a letter or mail carrier, any letter, postal card, package, bag, or mail, or abstracts or removes from any such letter, package, bag, or mail, any article or thing contained therein, or secretes, embezzles, or destroys any such letter, postal card, package, bag, or mail, or any article or thing contained therein [...] Shall be fined under this title or imprisoned not more than five years, or both.
The act of taking is relevant. It is irrelevant that you would receive the parcel later. You take it from the car on the delivery route. You also do trespass under whatever jurisdiction applies where the car is parked. For example, Criminal Trespass on Indian country is defined under 25.CFR § 11.411 (b). The rules in other jurisdictions are very similar: you are not allowed to enter the car, as it is clearly off-limits to the general public. The car is btw. supposed to be closed to prevent such, so you have to actually break property of the postal service (which is an extra charge to just the normal B&E).
(b) A person commits an offense if, knowing that he or she is not licensed or privileged to do so, he or she enters or remains in any place as to which notice against trespass is given by: (3) Fencing or other enclosure manifestly designed to exclude intruders.
A car door, even if not locked and left ajar, is an enclosure manifestly designed to exclude intruders, and the inside of a car is "any place". So, in the correct jurisdiction, this statute of criminal trespass does apply. And as pointed out above, taking the mail without the driver knowing is illegal. In some fashion, taking your own mail is also a strange case of obstructing the correspondence, which specifically calls out that the parcel has to be given by the mailman to the recipient (emphasis mine).
Whoever takes any letter, postal card, or package out of any post office or any authorized depository for mail matter, or from any letter or mail carrier, or which has been in any post office or authorized depository, or in the custody of any letter or mail carrier, before it has been delivered to the person to whom it was directed, with design to obstruct the correspondence, or to pry into the business or secrets of another, or opens, secretes, embezzles, or destroys the same, shall be fined under this title or imprisoned not more than five years, or both.
If it is discovered by the driver while still on route, they will have to call the base and investigate the missing parcel, which takes time from the delivery, so might constitute retarding the passage of mail. If you break the lock to the car, you'd be charged as Injury to mail bags:
Whoever tears, cuts, or otherwise injures any mail bag, pouch, or other thing used or designed for use in the conveyance of the mail, or draws or breaks any staple or loosens any part of any lock, chain, or strap attached thereto, with intent to rob or steal any such mail, or to render the same insecure, shall be fined under this title or imprisoned not more than three years, or both.
A Postal car, especially with a lock on the door, is such a device. And if you somehow had the key to the car, you'd break 18 USC § 1704 instead. Plus, your taking does possibly incur monetary damages to the postal carrier, so civil charges for that money and expenses in investigating would also accrue against the taking person.
civil lawsuits?
If you'd take the parcel, you make the postal driver accountable for the loss of the parcel and the worth of the package, as the internal system of the postal service does recognize that they did not deliver the parcel, did not scan it out at the home base, but they did scan it onto their route. So unless they can point the finger at you or a known thief, they might need to admit that they did not lock the car or committed some other misconduct that allowed someone to steal the parcel. This can lead to the financial loss of the delivery driver or them being fired. Should the mail carrier or the postal service discover it was you, the mail carrier can now sue you for the injury the lost parcel meant to them as you interfered with their work contract. The tort is Tortious interference.
Then, the mail service can sue you for intentionally interfering with the delivery contract the service had with the one ordering the delivery done: they were required to bring the parcel to the target and got paid for that. Only your action of taking did prevent this. Would you not have taken the parcel, they would have delivered, so you interfered with their contract.
Life Advice:
Approach the driver, get out a photo-ID (Drivers license, passport, ID-card etc) and ask them something akin to this "The website told me you might have a parcel for me. Can you look? I am this person, and this ID proves I live at the target address, as indicated on this ID." With those credentials in hand, the postal driver can check and give it to you but isn't technically obligated to. But as it often means they can save a few valuable minutes getting to your house, they might, especially if you know your mail carrier and are friendly.
On the other hand, it's extremely unlikely for letter mail to be given this way, as searching for a parcel on a truck is much easier than looking for the letter mails in the bags.