It's a self-solving problem, though. At that point, every remaining senior+ engineer will be paid a bajillion dollars (like they are now) and companies will start to invest in actual training.
When you read an article about a "skills shortage" it's usually more of a pay shortage and/or a terrible working conditions overage.