When someone calls you a Yankee it means they are saying you're an American or someone from the Northern Coast of the United States.
It's not bad to be called a Yankee but some people will think you're dumb if you call them a Yankee and some people may be offended by being called a Yankee.
That is especially if the person does not really know what it means.
So it's best to avoid calling someone a Yankee.
Some other countries call Americans who come into their country a Yankee although some Americans may misconstrue the meaning of being called a Yankee.
I'm not offended when I'm called a Yankee but some people are.
So it's best to avoid using the term Yankee when referring to other Americans.