Speaking from the experience of a friend, they started out by talking with their manager that they did not want to be a developer in the long term. Shortly thereafter, the manager announced to the team that the developer was going to start taking on project management tasks (like managing the project using Microsoft Project and leading the scrum daily stand ups). They continued in that capacity until they officially became project manager for another team. Now, years later, they are still managing but managing managers and a much larger team overall.
There are some technical product management positions. If you are looking for training and feel like that route and MBA will almost certainly set you down that path. Though I did not and got to a PM position. Luck is also involved. Haha
You're slightly moving the goalpost with your comment, because it's not necessary to go through formal training to be a PM. Engineers are tangentially involved in the product process pretty much always. The transition is essentially about taking more responsibility over the product and spending more time driving product vision as opposed to building. Passing a PRD to your manager if you thought a feature could be done better was encouraged at my last job.
Your manager will often support you doing this. Then, if you've been doing this well, you can speak about making a change to the PM role because you've proved yourself. If your manager does not support you doing this or the company doesn't need another person in a product role, then you might need to make a change.
FYI large companies accept internal applications for their APMs, which is a formal training program, albeit pretty much for junior employees only.
Be knowledgeable about metrics/kpis (and help create them if they don't exist), help your teammates grow through coaching, and work your way to be involved in those product discussions.
If you're not in such a position, try looking for a new job. So many companies need product managers and if you come clear on your ambitions, it seems to be easy to get past that initial wall.