There's 3 main stages:
- until 24: focus on physical training
- between 24 and 28: focus on technical training
- until 32: the mental attributes will mainly increase
To focus on physical training doesn't mean to leave the rest, what I mean is, until 24 is the best "window" to increase significantly his pace, strenght, agility... as his attributes are capped and can't really increase after this age. Not too high to reduce the injury risk but at a good level (depending on the player's injury proneness) to improve quicker these attributes. From 24, you can decrease a part of the physical training to maintain his attributes and increase the technical trainings, etc...
Another point is did you have the player in your team from his 16, 17, 18? Or did you buy him at 25, 26, 27? In the last option, you still can increase a bit of his physical attributes if he didn't have a good training in his past (and didn't reach his max potential attributes). Know that a the player's PA is an average/overall grade. It means when a player reached his PA, he can't increase anymore his attributes (he can't have 19 in pace if his possible max rate is 16 in this category, but it can be redistributed depending on your training focus (like -1 pace, and +1 strenght)).
A player can start to lose his stats around 30, but it all depends on your management. A player can keep ALL his attributes if he has the proper training, he plays regularly, you respect his QPN, no injuries... The position is a factor which should help you to prepare your training as well:
- a striker perform at his best between 24 to 28
- a midfield between 26 to 30
- a defender between 28 to 32
- a goalkeeper around 32
As you said, it depends on a lot of other factor too (tutoring, time play, training level, facilities, how long in your U18 training program, professionalism, ambition, injury proneness...).
Hope this helped you in some parts.