I am sorry he is doing that to you.
It is one thing to slip up and accidentally use the wrong pronouns or old name, but it is completely different to make rude and ignorant remarks about what you think of someone's gender.
Some people may not feel that way, but it honestly is. That's just as disgusting and thoughtless as people making remarks about someone's race or religion. Not only that, but that's like being a confirmed Christian and someone making ignorant remarks about a Jewish or Muslim faith and trying to pin them on you, when you're not even of that faith.
If he is causing you enough stress to be thinking about this when you aren't even around him, he NEEDS to stop pronto. Already he is in the wrong, and going out of his way to be a rude person to you, and you're saying you told him last year.
Some people are friends, some people seem like friends, and some people really are friends until they find out that your values don't align with theirs, but right now he is basically harassing you, and you need to let him know that you will not stand to be treated in that way.
If he thinks your feelings are a joke or a game or that they simply do not matter, you need to break that pattern. If he can't handle that, he can end the friendship.