the electron carries U(1) gauge charge -1.
the U(1) is gauged and mediated by the U(1) gauge boson which is the photon with zero U(1) gauge charge, thus $0$.
Now let us take this problem in the grand unified theory:
the X is a symmetry and associated with a X charge.
the Y is a symmetry and associated with a hyper Y charge.
question 1: there is a X gauge boson, is that a gauge boson associated to the mediator for the gauged X? So X gauge boson also has a X charge 0?
question 2: there is a Y gauge boson, is that a gauge boson associated to the mediator for the gauged Y? So Y gauge boson also has a hypercharge Y charge 0?
Wikipedia suggests that X and Y have zero X charges.
But Wikipedia suggests that X and Y have nonzero B - L charges $\pm 2/3$, and zero X, thus I conclude that X and Y gauge bosons have nonzero Y charges, due to $$ Y = (5(B-L)-X)/2 $$ https://en.wikipedia.org/wiki/X_and_Y_bosons
So how come Y gauge boson does not have zero Y gauge charge? (this is in contrast to the photon and X gauge boson example.)