Whenever a character serves as an improved or idealized version of his or her author, as a vehicle for the author's fantasies of power, allure, virtue or accomplishment rather than as an integral part of the story, that character is a Mary Sue. He may resemble his creator in most respects, but he drives a hotter car, lives in a posher part of town and has a cooler job. She may be as moody and self-absorbed as the novelist who invented her, but instead of boring the people around her these traits only enhance her crazy-girl magnetism, making her the center of everybody else's world as well as her own.
[. . .]
Because genre fiction tends to trade in wish fulfillment to begin with, you're far more likely to find shameless Mary Sues in mediocre mysteries, science fiction and romance novels.
[. . .]
What irks readers about Mary Sues is that telltale whiff of an ulterior motive. Instead of contributing to the seamless fictional experience readers want from a book, this character, they sense, is really a daydream the author is having about herself. It's an imposition, being unwittingly enlisted in somebody else's narcissistic fantasy life, like getting flashed in the park. And just about as much fun.(Laura Miller, “A reader’s advice to writers:Beware of Mary Sue,” Salon, 21 April 2010)
Come to know your Mary Sues
If someone is prone to create Mary Sues, they've got a psychological problem. If they attend to your advice and keep writing, my guess is not that the psychological problem has gone away, but that they now feed off creating characters that are more pleasing to the high-brow.
If you create Mary Sues, you've got a HUGE problem. Psychological turn-around may in fact come from spending more time attending to the Mary Sues you tend to create, with exactly what you are doing with them, rather than abandoning them quickly for the quick-fix turn to the literary. Also, Mary Sues are likely compensatory: there's a (much) better way to be than that, but until you managed the considerable self-change required so you have no further need of them, their service deserves some respect from you -- they weren't the friends you deserve, but they were your friends.