Yes, teachers (including both professors and TAs) should absolutely intervene in such an instance. As everyone else has said, non-discrimination policies would most likely prohibit such offensive misogynistic expression in a classroom environment, and these are policies with which I would recommend all teachers familiarize themselves before they enter the classroom.

Let me mention one more reason that you should not just overlook such an incident: to prevent such things from happening in the future. Not all students are completely familiar with what constitutes improper behavior in a classroom. If nobody does anything, what's to stop that student from doing the same thing again?

Here's a related story from my own experience. One time, when I was a TA for an engineering calculus course, I got an in-class group assignment back from a pair of students, where one student circled the other student's name and wrote "is gay" as a joke. Being gay myself, I was pissed. (I had also hoped that the idea that "gay" could be used an insult had gone out of acceptance by that time, in 2012. Guess not.) At the time, I didn't know who did it; it could've been someone outside the pair, but it certainly wasn't the student whose name was circled due to the handwriting being different. I also didn't want to falsely accuse anyone, or put anyone on the spot. I didn't quite frankly care who did it; I just wanted to make sure my students knew that this behavior was unacceptable.

So the next class, I read the university non-discrimination policy to both my classes and I told them what had happened, without naming anyone (or the class it happened in). I said that I didn't care what anyone said or did in their free time, but in my class, I wouldn't stand for people doing things like this.

My first class, I couldn't hide my tension or my anger when I was saying all of this. The second class, which was the one with these two students, I did the same thing, but I was much calmer because I had already done this with the first class. The two students ended up apologizing to me when I handed back the paper, and I (calmly) said that I wasn't accusing anyone of doing anything, but I just needed to make sure that everyone understood that this wasn't acceptable.

In retrospect, the only thing I would have done differently in my case is practice my speech beforehand so I could convey the seriousness of what I was saying without the tension and anger I had during the first class. (Some people don't react as well to tension and anger.) That aside, I did feel good affirming for my students, some of whom were likely LGBT themselves, that my classroom was not a place where I would accept any such inappropriate or discriminatory behavior. And finally, I made it way less likely for anything similar to happen in the future on my watch.

Your case is different, because it involves quite the open display of inappropriateness. In your particular case, I would walk up to the student and tell this person that wearing such a shirt in the class is inappropriate and goes against school policies, and that he needs to leave and change into something else before he returns to your class. The students who are concerned about the shirt will most likely notice your action and feel relieved that you are addressing it.

I'm not so sure that you should call him out from the front of the classroom, although you certainly have the right to do so. The student might find it humiliating to be called out in front of the entire class (especially in a large lecture), and moreover it's a little impersonal. (Although I addressed my situation with the entire class, keep in mind that I didn't know who had done what and I didn't name anyone. Also, if you just read the non-discrimination policy out loud in your case, it will be pretty obvious to everyone who you're addressing.) I think the best outcome would be with a private or semi-private, direct conversation as I suggested above.

On the other hand, if you're intimidated and worried about possible physical violence, then you could opt to ask this person to leave in a semi-private manner but with a reasonable physical distance between the two of you, while many other students are around. This allows for witnesses in case anything goes awry. (This does seem like an unlikely scenario, but your safety is paramount.) If this option is not safe enough to you, then as Pete L. Clark has suggested, you should call campus security and wait until they arrive before starting your class.