  We study the generation of large scale primordial magnetic fields by a
cosmological phase transition during the radiation dominated era. The setting
is a theory of N charged scalar fields coupled to an abelian gauge field, that
undergoes a phase transition at a critical temperature much larger than the
electroweak scale. The dynamics after the transition features two distinct
stages: a spinodal regime dominated by linear long-wavelength instabilities,
and a scaling stage in which the non-linearities and backreaction of the scalar
fields are dominant.This second stage describes the growth of horizon sized
domains.We implement a formulation based on the non-equilibrium Schwinger-Dyson
equations to obtain the spectrum of magnetic fields that includes the
dissipative effects of the plasma. We find that large scale magnetogenesis is
efficient during the scaling regime.Charged scalar field fluctuations with
wavelengths of the order of the Hubble radius induce large scale magnetogenesis
via loop effects. The leading processes are: pair production, pair annihilation
and low energy bremsstrahlung, these processes while forbidden in equilibrium
are allowed strongly out of equilibrium.The ratio between the energy density on
scales larger than L and that in the background radiation r(L,T)= rho_B(L,T)/
rho_{cmb}(T) is r(L,T) sim 10^{-34} at the Electroweak scale and r(L,T) sim
10^{-14} at the QCD scale for L sim 1 Mpc.The resulting spectrum is insensitive
to the magnetic diffusion length and equipartition between electric and
magnetic fields does not hold. We conjecture that a similar mechanism could be
operative after the QCD chiral phase transition.
