Diggles or some math nerd will have to give you the answer that is most efficient. I think the answer will change depending on what level you're shooting for. I'm thinking if I went right for level 33 I'd be better off without retiring. If you're going for level 35 (which is like 140,000,000 XP) you're probably better off getting to a higher level to get the 3% boost of experience every tick.
I'm sure I could do some trial and error maths (the best kind) to figure out a decent answer, but fuck that, I hate programming and math with a passion, and if I get my mind into that frame this early in the day, the rest of my day will be fucked.
But just to give you an example, I'm a 9th generation player. 9 x 8,892,403 (experience needed to retire) = 80,031,627 experience. Level 33 requires 71,139,224 experience. But for every 8,892,403 you'd have to subtract 3% for the bonus I gained from retiring...so I've basically set up your math equation, just plug in the numbers or some function....and go