It could be the teenage stage. Or it could be her personality is still developing or something else. As far as how long it lasts... well, I'm still waiting for Jaia to outgrow it and he'll be 3 next month. 
What I have done that helps a lot is to make those borders REALLY clear, be super consistent and offer consequences for stepping over the line. Those consequences would depend on the specific behavior, of course, but they don't have to be painful or scary. In fact, with the new stuff I'm learning about how some competition obedience people train their dogs, I can see me making a "game" out of obedience a lot in our future.
What I have done that helps a lot is to make those borders REALLY clear, be super consistent and offer consequences for stepping over the line. Those consequences would depend on the specific behavior, of course, but they don't have to be painful or scary. In fact, with the new stuff I'm learning about how some competition obedience people train their dogs, I can see me making a "game" out of obedience a lot in our future.