While it's a tv show and not a magazine(but maybe there was some novelization, or maybe you stumble upon an early script), this story looks a lot like 'the pretender'.
Jarod (no last name) was kidnapped as a very young kind an held captive in a secret organization to help them solve hypothetical problems (spoiler, the problem were not so hypothetical). After a while he escaped, and take a different identity (and skill set) every week to help people.
While the story revolves around him as a youg man, there is a lot of flashback of him as a boy. Besides, being kept out of the real world during his boyhood, he can be very childish at some point.
Pro :
- boy/young adult with extraordinary potential
- Youth detention center (while not exactly in the same context).
- Countless experiences as different persons.
Against :
- TV show.
- Not literally body snatching.
- The end does not match.
Another case of being put into body (more literally this time)in order to identify and solve problems is another TV show quantum leap.
Sam Becket is a very intelligent scientist (i don't remember the show worrying about his youth) who, due to an accident working on time travel jump from people to people in time.
Each episode end with the protagonist waking up in the body of the next one, generally in a cliffhanger. So this can match the end you remember.
Another very long shot, I admit.