I don't speak German, but from the examples you've given I would say that the English and German usages are similar, but not identical. In English, it's almost always a rebuke, rarely a warning. It refers to forgetting about social rules, and your place within them. The expression can be mild or strong depending on the tone of voice, the speaker and the context.
In your examples:
John, we are going out to dinner tonight. Please don't forget yourself.
A mild rebuke. John has behaved badly in the past, and the speaker is gently requesting that he control himself tonight. Depending on the tone of voice, this could be a desperate plea from someone who feels slightly inferior to John (and therefore doesn't want to use stronger language) or a patronising order from someone who feels superior to John to the extent of treating him like a child.
I believe you forget yourself sir!
A strong rebuke from a social equal or superior. The speaker is very angry, and yet is trying to stay within the social rules himself.
I'm forgetting myself. I haven't offered you a drink yet!
The speaker has caught himself out in a social error, and is at once acknowledging his mistake and apologising for it. It's a mild self-rebuke, although tone of voice and context will show how embarrassed the speaker feels over the faux pas.
As you can see, it's all about context. The expression is almost never used in isolation, so the context is usually plain. The third one is probably the most common, though.
Finally, can this expression used as a threat or warning as in German?
It can, but it's not common. In English, such a threat would usually be wrapped up in a few more words. ("If you don't stop that, I might have to forget I'm a gentleman.") Like the second example, above, the speaker is trying to stay within the rules himself, while making it clear that he finds the other person's behaviour unacceptable. However, as social rules erode, this usage is becoming increasingly old-fashioned.
Best Answer
I'd render this with something like:
or
or
or