I'd like to answer this from a female perspective as the other answers appear to be male.
First off, just because she wore it once does not mean she is "aware" it's see-through and just chooses to wear it anyway. More than likely, she really has no idea and will be embarrassed by it. (fitting rooms do not offer realistic "sunlight" lighting)
I think the most ideal time to have said something was around when you first noticed. Depending on the closeness of the relationship and how you two interact, I'd try to word it as neutral as possible. Saying something like,
Hey, sorry if this is awkward, but did you know your top is a bit transparent in the sun?
Or I really like Joe S's wording as well.
If she does know and chose to still wear it, I'd expect her to be able to shrug off your comment without issue.
If she does not, I would expect her to be a bit embarrassed, turn to her friend and go, "OMG is he right?!"
Since you did not mention it the first time, I wouldn't mention it until you go swimming again and "notice" it again. If her boyfriend is there and you guys have a decent enough relationship, maybe make a comment to him in a concerned tone,
Hey man, does Jess know her top is kinda transparent?
I'd make a comment at a time where it seems like you just happened to notice (not that you've been mulling over this for days). Maybe if you're grabbing her a drink or something, when you go to give it to her, mention it then.
Some other things to keep in mind:
- Try to keep it as private as possible. Make a quiet comment to just her. I think if a close friend of hers or her bf are in within earshot or right there, you're fine bringing it up.
- Try to down play it to alleviate any embarrassment she may feel if she seems really taken aback by it.
Location wasn't stated, this is a U.S. perspective.