You have touched on a point here which, in my experience, often gets glossed over, mentioned offhand, or mentioned indirectly (meaning it would be hard to realize it's the same point being mentioned without already knowing the answer) in first treatments of QFT.
You may have heard it mentioned at some point that the modern perspective on gauge symmetry is that it's a redundancy in our description rather than a symmetry which really tells us something. This will usually be mentioned in passing, but not actually given any substance till one is introduced to the Faddeev-Popov method which involves integrating over only the gauge-inequivalent configurations in the Feynman path integral. How much detail or justification is given for this would then depend entirely upon the source you're working from.
Off the top of my head, I remember what the following sources mention on the matter: David Tong's gauge theory notes mention offhand that the Noether charge generating local gauge transformations should annihilate physical states (which is equivalent to @ACuriousMind's comment about BRST quantization) and are generally good notes on gauge theory. Weinberg's QFT volume 2 which, if you can make your way through it, has a very nice discussion about the connection between BRST symmetry, the Faddeev-Popov method I mentioned, and the annihilation of physical states. There's also a QFT book by Nair which dedicates some time to a more canonical treatment than most modern books, and has some nice things in general to say about gauge theories.
To get more at your question, however, I can first tell you what the answer is, then make a couple comments about what's going on. But since it's actually a fairly involved thing you've hit on, I will have to leave you with a couple references which I found very helpful when I first encountered these ideas properly.
So, (I may have some signs off here), the $G$ you're looking for will look roughly like
$$
G[f]=-\int d^3x f(x)\partial_i E^i
$$
where $E^i$ are the components of the electric field (just using the canonical commutation relations between $A_i$ and its conjugate momenta you can show that this indeed genergates the right transformation). You may note that $\pi^i=-E^i$ is the momentum canonically conjugate to the vector potential and that this quantity is the Noether charge implied by Noether's theorem applied to the gauge symmetry. You may have heard before that Gauss' law, the left hand side of which is being integrated against $f$ here, is a constraint equation, which is true if we were to write out the Maxwell Lagrangian and observe that $A_0$ plays the role of a Lagrange multiplier. This sort of thing is actually entirely typical of gauge symmetry...the generator of gauge transformations always looks like a constraint which vanishes on the equations of motion. This is actually the reason behind why the generators of gauge transformations annihilate physical states. They represent constraints which must be imposed on our states.
So, this has all been handwaving and vague statements. I can add to them even further by pointing out that it's possible for some gauge transformations to actually produce a charge $G$ which does not vanish, and these therefore will act non-trivially on our physical states despite being "gauge" transformations. Indeed, we know this needs to be the case because electric charge exists. This leads to the idea of asymptotic symmetries, which I don't think I can really do any justice to in this post. The nice thing is that essentially everything about them can be understood classically, so there's no barrier to entry if you're still learning QFT (as you mentioned in a comment). I can, however recommend some references. This reference by Banados and Reyes I found to be a good first introduction to some of the ideas here and fairly approachable. I find Dirac brackets (a modification to the Poisson bracket of classical mechanics) hard to work with though, so I can also recommend this which uses, in my opinion, more elegant methods if you don't mind playing with some differential geometry, though their goal is more focused on spacetime symmetries and gravity (where these asymptotic symmetries are more commonly discussed). The ideas, however, are essentially the same for non-spacetime symmetries, though some of the technical details change.