What should I do when a former student tells me about misconduct from one of their current TAs?
Is this generally acceptable conduct for graduate students?


I think you know it's not. To tell someone that they are so bad at a subject that they should quit is definitely rude and out of line for pretty much anyone in a supervisory capacity, especially if their advice was unsolicited. That said, if someone asked for a fair evaluation, telling someone they might be more successful in another field isn't per se inappropriate. 



It seems possible the TA was rude to her because of her gender. Anti-women bias in CS is well-known, books have been written on it. Unfortunately, we don't know right now whether this colored his actions. But, it does mean you should encourage her to report his actions in case he has been similarly rude to other students, but especially women. 

As for what you should do, I recommend you help her and be supportive if she decides to make a complaint. However, you shouldn't make it for her. I say this for a few reasons, in decreasing order of importance:


You've stated you didn't witness this exchange, so as it stands, this is an issue between your friend, her TA, and the professor. So all you have to go on is what she said. It sounds like we both believe her that the TA was very rude, but maybe there was a language barrier on either or both parts.
You're not a professional advocate. You don't want to do something wrong and sink her case for her.
It's my personal philosophy that it's not your place to try to take care of someone's grievance like this yourself. 
Unless she is committed to anonymity, the professor is likely to want to talk to her anyway. You can't answer all his questions as well as she can. But if you are willing, offer to come with her to the meeting with him for support. 
Gender affects every interaction we have. The possible  gender issues only make this case more delicate. I would suggest any man to not try to "handle" this issue for a woman unbidden. (It doesn't sound like you are, but a note for other readers).


I would only go so far as to offer to pass on an anonymous letter that you put your weight behind, if she doesn't want to reveal her name to the professor. I would just stay away from putting her complaint into your words.