This is a follow-up on this answer, where ACuriousMind wrote
Formally, both the mass and the charge classify certain irreducible representations of the Poincaré group and the circle group, respectively.
I understand the basics of representation theory, and I know the $U(1)$ gauge transformations of the QED Lagrangian (I suppose that's the connection between electric charge and the circle group $U(1)$). I also have seen the basics of non-abelian gauge transformations.
However, I wasn't aware that there is a connection between representation theory and the conserved electric charge. Moreover, I had no idea that mass had anything to do with irreps of the Poincaré group.
What are the details of that connection? Why do mass and charge classify irreps?