I thought anybody who leaves Storybrooke looses their memory. How would she be excluded from that?
Uh, because she was never cursed. They made it quite clear that Emma can come and go into Storybrooke anytime without any problems. Her and August left Storybrooke in The Stranger. She has no fake memories to lose. She was never cursed.