I can't help but wonder if it is brought on by depression or struggling with her gender. My girlfriend is 27, and there are very few people that know that she is a girl in a man's body. Not even her parents know the truth. I can only imagine how that feels for her.
You said it yourself.
It's likely a complex picture, the solid-basis of which is being trans, not being able to express herself and feeling isolated, thus feeling depressed, maybe even having depression. Then on top of that there are triggers, some of which come and go, some of which are re-occuring that cause her to slip into this.
I understand fully as I badly want to express myself as a woman but can not right now. I am the same age as your gf. I have been wanting to transition since the age of 16, so over a decade now and I feel so trapped and this causes me intense frustration. I live with my wife and I get jelous of her that she's free to be cisgendered and is comfortable in herself and has contact with other women as a woman. I stay at home because people think I'm gay or find me uncomfortable to be around. If women see me as straight they think I am hitting on them the way I am so friendly. When I don't make a move they get very upset and think I am playing them. In reality I just want some friends who are female. I've tried to make friends but can't and it's very lonely. So very often I just retreat in on myself.
When I've gathered enough strength to face the world again I go out there and when my gender gets called into question again I just lose heart and feel like I am back at square one.
My advice is be there for her. Let her her time and she'll return to you when she feels ready. Just let her know she is loved and that you'll be there for her.
Feel free for you or your gf to PM me if that would help.