Just to be clear: I don't think that Rey is a Mary Sue. I think that it came up because she has something in common with the trope, but she doesn't embody it. So my short answer to the question at the end is, basically, that those two things are pretty much what defines a Mary Sue.