  Using second-order gauge-invariant perturbation theory, a self-consistent
framework describing the non-linear coupling between gravitational waves and a
large-scale homogeneous magnetic field is presented. It is shown how this
coupling may be used to amplify seed magnetic fields to strengths needed to
support the galactic dynamo. In situations where the gravitational wave
background is described by an `almost' Friedmann-Lema{\^i}tre-Robertson-Walker
(FLRW) cosmology we find that the magnitude of the original magnetic field is
amplified by an amount proportional to the magnitude of the gravitational wave
induced shear anisotropy and the square of the field's initial co-moving scale.
We apply this mechanism to the case where the seed field and gravitational wave
background are produced during inflation and find that the magnitude of the
gravitational boost depends significantly on the manner in which the estimate
of the shear anisotropy at the end of inflation is calculated. Assuming a seed
field of $10^{-34}$ $\rm{G}$ spanning a comoving scale of about $10 \rm{kpc}$
today, the shear anisotropy at the end of inflation must be at least as large
as $10^{-40}$ in order to obtain a generated magnetic field of the same order
of magnitude as the original seed. Moreover, contrasting the weak field
approximation to our gauge-invariant approach, we find that while both methods
agree in the limit of high conductivity, their corresponding solutions are
otherwise only compatible in the limit of infinitely long-wavelength
gravitational waves.
