At the start of Spirited Away, Chihiro's parents are transformed into pigs when they eat food in the spirit village.
Chihiro Ogino later eats a bun while seated on a balcony.
Why was she not transformed into a pig?
Chiriho's parents were turned into pigs because they kept eating food that was meant for the guests.
The food that she eats throughout the film was freely given to her, and in most cases intended for the staff at the bath house (which she becomes).