Mary Sues are appealing to novice writers because they're an outlet for wish fulfillment - it's easier for the writers to put themselves in the shoes of a character with no real flaws. But powerful original characters often have profound flaws that make them who they are. To go from fanfiction to engaging original fiction, you must think about your characters' history and how that colors their thinking. Let them make mistakes and be wrong (without pages upon pages of angst and regret over it). Take that one thing that helps you really relate to them and let that inform how they'd react to different situations. It's a balancing act, believe me, but always thinking of characters as individuals will help keep you away from Mary Sue territory.
One of the main strengths of writing videogame fanfiction is that it helps budding writers learn how to handle larger casts. Many videogames, especially RPGs, star an entire ensemble of characters, and sometimes the best story ideas come from how wildly opposing personalities interact. Being able to create interesting stories requires seeing the world through the eyes of drastically different characters and figuring out how they would think and act.
Remember that every character has his or her own quirks, speech patterns and tics. The cheerful mechanic girl might flit about while covered in grease and drop the letter "g" at the end of words like "getting," while the taciturn warrior might not use contractions often and respond with one word answers as much as he can. The longer you write about them, the easier it becomes to hear each of their voices. Keeping in mind how all these personalities bounce off each other makes it all the easier when writing your own groups of characters. The ability to put yourself in different character shoes, even ones that you created, is more familiar for the time that you spent writing with videogame characters.
To speak from personal experience, my first serious forays into writing were fanfiction. Ideas came fast and furious, often too fast for me to get all of them down. This consistency prepared me for sticking with original ideas later on. I was able to stay excited about a story from my time writing fanfiction.
In my Final Fantasy VIII fanfic, I wrote about a caustic and emotionally unbalanced young woman that had to deal with a past she didn't fully understand. During the story, the game's main characters all had their own missions and problems to deal with. Looking back, this character was a Mary Sue, ingratiating herself into the main characters' group immediately and having the main story revolve around her. Even though she had negative traits, the rest of the cast was all too willing to overlook them - those that hated her initially ended up liking her or even obsessing over her.