I have two theories on this one.
First; how do we know she's never been trained, just because at first she's not even sure the force is real?
We know very little about Rey's past. She was left on Jakku by some family member who she is waiting in vain for their return. She was left there ate a very young age but Luke had started a new, Jedi academy. Previously the Jedi began training almost in infancy and remember, the look on Luke's face showed no surprise at all when what the audience believed she would be a stranger to the only Jedi master.
Tragic events would have caused suppressed memories for the young girl.
Next; Rey's first steps with the force followed Kylo Ren's failed attempt to use the force to brutally extract information from Rey's mind. But Kylo Ren is not fully trained. I suspect that he unwittingly gave Rey much more information in that exchange than he got from her. This is supported by the her comment to him that he fears he will never measure up to Darth Vader.
Even more than this is the possibility that both points may be true and Kylo Ren's clumsy fumbling around in her brain manages to unlock suppressed memories of the training she already received.