I wouldn't say anything about it to anyone in the class. If they bring it up and you want to maintain your stealth, just shrug it off. "I don't know, that was weird now that you mention it. Huh."
I would say something to the co-worker that misgendered you, and the teacher if they are in the know about your status. Let them know that while you understand your documents say one thing currently, that that is not the case and you would appreciate their continued discretion and proper use of your name and male pronouns. If they react badly, take it above them. Especially if you live in a place with trans legal protections.