The base model M2 14“ MacBook Pro is listed at $1999 on Apple’s website. The RAM upgrade to 32GB (that you don’t need today and probably won’t even notice tomorrow, unless running specific very heavy workloads) costs $400.
That’s 20% of the price of a new machine - or the equivalent of buying your next laptop in 8 years down the, road instead of 10 years. These two years are much more likely to make a difference.
This is what i try to tell people who tend to over-capitalize***. Sure, you can purchase more RAM or storage today but those aren't the only things that will make the machine obsolete.
IO ports, storage speed, CPU instruction support for new features, and software support will all kill the usefulness of a machine too. I tell people to budget on replacing every 3-4 years - if it lasts longer, great - but you'll generally get a huge bang for buck upgrade after 3-5 years anyway, be covered for most of that time by applecare and maintain software update support. You don't fall too far behind with new IO port standards (and security features) either.
All you're doing by over-capitalizing is buying things you MIGHT need in future at a vastly more expensive cost than they will be by the time you require them. You're also locking yourself out of new breakthrough technology (should it happen) for years longer than if you plan to flip a machine more frequently.
Shifting from your old working mac to a new mac is relatively painless these days during install. Definitely easier than if you're trying to migrate because your old machine totally died.
edit:*** if there's an actual need for higher spec that isn't over-capitalizing. but if its to anticipate some nebulous possible future requirement... it's just throwing a lot of money at expensive hardware today that will be much cheaper in 3-5 years and come with a host of other benefits.