The problem with Android is that it doesn't work like Windows does - it's dependent on support from the manufacturer which means that even if your phone was capable of running a later version of Android, if the manufacturer hasn't upgraded their blobs, it wouldn't work anyway. Pity, as I agree with you otherwise (my G5 Plus is still stuck on 7, despite Motorola saying they would provide an upgrade to 8 over a year ago).
This was true before project treble. Nowadays blob are separated form OS version. It makes not only updating but porting different flavors of android much easier. But manufacturer had to implement treble first.
Any Android One phone gives you that. E.g. Nokia 6.1 receives monthly updates.
use Lineage OS custom rom, which provides updates all the time.
I used to flash CM on my phines since having HTC desire (2010), later on i was choosing popular phones with CM support. Samsung, HTC, nexus, but its been years since i flashed some stable release.
Now i am on galaxy s7 edge. Few months i was no longer able to automatically pull nightly update from linage. Wiki said that it was no longer supported. They brought support back, but it showed me that I can't relay on it without compiling by myself...
I went back to stock rom and I am happy with that. Everything just works (eg phobe is not rebooting on incomming call while comnected to bt speaker), lots of cool UI stuff (while custom roms were meant to have more of them).
If manufacturer will drop support then i will change phone.