Electromagnetism is expressed in the same formalism as General Relativity:
General Relativity is described by relating the 10-dimensional field of energy and pressures, to the 20-dimensional field of space-time curvature.
This space-time curvature is understood as the curvature of the tangent bundle of space-time, where the fibre of this bundle at each point is the tangent space (the space of small vectors around this point: this is the space of "speed vectors" for imaginary movements of an abstract point across space-time, in duality with the space of 1-forms that are the possible differentials of scalar fields at this point).
We have a connection on this fibre bundle, i.e. a correspondence between nearby fibres, so that when going around a closed curved in space-time, the fibre undergoes "parallel transport" and comes back to itself not identically but "rotated" by an element of the Poincare group at this point.
Now electromagnetism is the same, replacing the tangent bundle by an U(1) bundle, that is, the fibre is a 1-dimensional Hilbert space.
Whenever we choose a convention of trivialization of this bundle, the connection (which gives the correspondence between the fibres above 2 points along a line connecting these points) appears as a 1-form (see wikipedia "differential form") that is usually called "Electromagnetic four-potential". Gauge transformations (which modify the 4-potential by the differential of a scalar field, keeping the electromagnetic field unchanged) are conversions between different possible trivializations of this bundle (turning each fibre by an angle given by this scalar field). Thus, the electromagnetic field is the curvature of the connection of the U(1) bundle in the same way as the Riemann curvature tensor is the curvature of the tangent bundle.
Now you may ask : why is the group taken as the cyclic group U(1) (the group of rotations in a complex line) instead of the simple additive group of R ? After all, both would work as well for classical electrodynamics.
The answer is that we need this for quantum physics : all electric charges are multiples of an elementary charge. The contributions to the wavefunction of an electron at a given point of space-time from different possible worldlines, are calculated as exp(iS/в„Џ) where S is the action of the worldline. This action is given as the integral of the electromagnetic four-potential along the worldline, or more meaningfully, it is the parallel transport by this connection, so that the actions from different worldlines differ by the integral of the curvature of the connection in the space between these lines (any surface bordered by these lines).
Now the reason why the fibre is U(1) is that when the transport along 2 worldlines differ by 1 quantum of action (S2-S1=h), their contributions to the wavefunction are identical (exp(iS1/в„Џ)=exp(iS2/в„Џ)).
B is the curvature above space-like surfaces (contained in the simultaneity space of the given observer), while E is the curvature above surfaces extended in 1 space dimension + the time dimension.
If we want to enter the details of the wavefunction of the electron, it is a bit more complicated because it has a spin 1/2, so that the fibre has not 1 complex dimension but 4, that is the sum of dual spinor spaces, where each spinor space has 2 complex dimensions, and its space of Hermitian forms is identified with the tangent space at this point of space-time. But the point is that the gauge symmetry of electromagnetism operates there by multiplication by a field of unitary complex scalars.