Wow, everything is 'potentially transgender' now. Back in my childhood (not that long ago), it was just about wearing clothes - but of course everything was far less ridiculously dilineated along gender lines.
Your DD could potentially be transgender ... or ... she might just prefer the sorts of clothes that most boys these days typically wear.
Honestly? I would just go with it for now. She is so young. I don't think anyone is going to give her too much of a hard time about swimming trunks - which, by the way, are very common for girls down our way.
I understand your wider concerns about her friendships, and experience at school. I would really keep the communications lines with her open, and chat every day. Ask her questions, but keep it light. Get her think about why she prefers certain things, and what that means as she navigates the social scene at school. Not to persuade/dissuade her any which way, just to help her to see how her own choices might impact on things. Try to find out if she is actually unhappy, or whether she seems to be floating along OK. Talk to her teacher.
Primary school might not be the most amazing experience for her, it that doesn't mean she won't come into her own in secondary school, or whatever she chooses to do after that. As long as home is a rock solid place for her, then she should be just fine.