Second Star to the Right - S2-E21
Continuity mistake: When Baelfire eats the bread, what remains of the loaf keeps changing shape and position on the tray between shots, and the two other loaves also move around. When Wendy picks up the tray, all three loaves are untouched. (00:02:20)
Answer: He knows who she is because he knows that the fairy tales are true. He was also shown to sneak out to go see Emma or someone else. Sometimes he succeeded, sometimes he didn't. This is how he knew to look for her despite his strict mother.