You also have a considerable amount of time/miles after purchase to add an extended warranty... it does not have to be done at time of purchase.
Gives you time to drive the thing, make sure you want to keep it around for awhile before plunking down a few extra $k.
The warranty is transferrable, but no one is going to pay you extra for it on resale.
And technically you can ask for a refund of the unused portion if you sell, but goooood luck going that route.
This is why dealers push extended warranties on new vehicles.. because the vast majority of vehicles are not owned long enough to use them. It's free money for them.