Let's say you have 2 levels of sorcere, 7 levels of fighter, 1 level of stalwart defender. You retrain 1 level of fighter for arcane archer. You meet both requirements for arcane archer. You then retrain another level of fighter for stalwart defender because you still meet the bab prerequisites. You now are a sorcerer 2/ Fighter 5/ Stalwart Defender 2/ Arcane Archer 1.
So far the arguments of not being able to use a prestige class' BAB to qualify for itself no longer apply.
You can now switch another level of fighter for arcane archer.
Eventually it can look like Sorcerer 1/Fighter 4/ Stalwart Defender 2/Arcane Archer 3