There is. I think it's the only way and most Team Rocket members don't even know such a thing exists.
[He wouldn't have known if some higher ranking officer didn't tell the whole Team Rocket network.]
Every Team Rocket starter Pokémon has a microchip implanted on them. Apart from tracking people, it also seems to ensure that the Pokémon are loyal to the team. So in order to get out you need to take the chip out, and the only way to do that is to go to nurse Joy... which means officer Jenny will find out you're a member and you get two weeks of community service.
audio
[He wouldn't have known if some higher ranking officer didn't tell the whole Team Rocket network.]
Every Team Rocket starter Pokémon has a microchip implanted on them. Apart from tracking people, it also seems to ensure that the Pokémon are loyal to the team. So in order to get out you need to take the chip out, and the only way to do that is to go to nurse Joy... which means officer Jenny will find out you're a member and you get two weeks of community service.