The story
The figurative sense is by self-evident metaphor from the literal sense. The thought of poachers turned gamekeepers goes back centuries; for example, William Tinsley said in his memoirs that "There is an old saying that the most expert poachers make the best gamekeepers. I do not think the saying is true as a rule […]".
Etymology from Wiktionary, CC BY-SA 4.0.