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.
I think it is very important that you tell the supervisor that this kind of comment was made. You have no idea how many other people may also have on the receiving end or how many were of people who have been traditionally subjected to such comments or assumptions. If no one speaks up, then change will never happen. You can read the stories of many women who have been highly successful in CS and been subjected to this kind of thing.
A TA is not in a position to do academic or career advising either. A TA recommending going to tutoring for that specific course, that is appropriate. Making hurtful personal comments, no. Making aptitude and ability assessments, no. Even without the added issue of potentially being sexist, the comment is out of line and inappropriate and contrary to good pedagogy in CS (see).
How you tell the supervisor is a somewhat separate question. OP is a former staff member in the department; he may have a relationship with the chair or with a faculty member who could potentially be helpful.
Of course you should not mention the student's name without permission. As suggested by @Azor_Ahal OP could ask the student to do an anonymous statement if she is not comfortable sharing her name but stating that she is trustworthy. Depending on the department, I would suggest speaking with the immediate supervisor first, then potentially with the department chair especially if the supervisor seems dismissive. Alternatively, if there is someone in the department who you know has been an advocate for people from underrepresented groups OP could ask that person for advice about what to do.
IMO, graduate TAs are in a difficult position w.r.t. this. If they were an undergraduate TA, they're peers of undergraduate students and this could be understood as a peer's joke. It might not be entirely appropriate, but I doubt the average undergraduate will think too much into that. If they were a faculty member, it might be considered real advice, which might be more problematic; but most undergraduates will at least agree that a professor would be in a position to give them advice.
But graduate TAs pose a problem: they're neither junior enough to be considered peers, nor senior enough to be in a position to give advice. So, I'd say, although none of the three classes of people mentioned above should give such advice, graduate TAs REALLY should not do so.
I would say that the behavior is not appropriate, and the TA should receive some sensitive training. But then it should be the student's issue, and you should encourage them to talk to the instructor and/or the department chair. Tell them about their potential options. But don't escalate this issue yourself; you are not in a position to report this either (just as the TA was not in the position to say what they said). If the student wants to do something they would be grateful to you; if they decide not to do anything, it's up to them.
PS: I have been an undergraduate, TA, and (weirdly enough) a college-level course instructor, but never a grad TA. But nevertheless I'd like to put in my 50 cents.