How do you define the sin of taking the Lord's name in vain?
Well that's a quote from the Ten Commandments: "Don't take the name of the Lord your God in vain." The idea of vanity (and I think the Hebrew carries this connotation) is "don't empty the name."
So it doesn't just refer to a certain tone of voice or a certain use of the word. It's dealing with God and speaking of God in a way that empties him of his significance.
This includes both throw-away words—like "God!" or "Jesus!"—as well as speaking about him in trifling and flippant ways. Not just swear ways but cheap ways, low and insignificant ways that just treat him like a commodity. And when you hear them you sense that there is no weight to that sentence, no corresponding emotion to that statement. It seems to have just been gutted.
God, Christ, the cross, the things he is and the things he did are great, and they're weighty. And there's a certain corresponding demeanor of worship that should be there.
So I think taking the Lord's name in vain is more than "O my God!" or "Jesus Christ!" It is that plus more.
The positive way to look at it is to revere God, love God, delight in God, know God, fill up God with all that he is. And then out of the abundance of the heart the mouth will speak.
I think it is far better to take the commandments and not focus so much on the negative—that is "don't lie, don't commit adultery, don't steal, don't kill"—but rather focus on where those come from, and put the emphasis there. And here, "don't take his name in vain" would mean that you take his name in vain because he is empty to you. Your mind doesn't feel the weight and fullness of his glory.
So that's the key: vain is empty. Don't empty God of his weight and his glory. Fill it up rather than emptying it.