Next step should be mandatory software updates. For something like 7 years from initial sale. Which would allow 2 years of normal sale cycle and then at end 5 year of support.
There is already legislative warranty framework around compliance to promised specs. This means if the date is not honored, customers can turn against stores and return the products. Stores can then return against distributors/manufacturers, etc.
Also forbid sales of any network connected devices (phones, tablets, TVs, routers, etc) past that date because it's a wide security risk, particularly for people who are IT analphabets.
You'll then see how spectacularly quickly everyone lines up to security update schedules and standards. They will also find a way to prolong the date for devices that sell well.