  Observations indicate that intergalactic magnetic fields have amplitudes of
the order of $\sim 10^{-6}$ G and are uniform on scales of $\sim 10$ kpc.
Despite their wide presence in the Universe, their origin remains an open
issue. Even by invoking a dynamo mechanism or a compression effect for magnetic
field amplification, the existence of seed fields before galaxy formation is
still problematic. General Relativity predicts an adiabatic decrease of the
magnetic field evolving as $|\mathbf{B}|\propto 1/a^{2}$, where $a$ is the
scale factor of the Universe. It results in very small primordial fields,
unless the conformal symmetry of the electromagnetic sector is broken. In this
paper, we study the possibility that a natural mechanism for the amplification
of primordial magnetic field can be related to extended teleparallel gravity
$f(T, B)$ models, where $T$ is the torsion scalar, and $B$ the boundary term.
In particular, we consider a non-minimal coupling with gravity in view to break
conformal symmetry in a teleparallel background, investigating, in particular,
the role of boundary term $B$, which can be consider as a further scalar field.
We find that, after solving exactly the $f(T,B)$ field equations both in
inflation and reheating eras, a non-adiabatic behavior of the magnetic field is
always possible, and a strong amplification appears in the reheating epoch. We
also compute the ratio $r=\rho_{B}/ \rho_{\gamma}$ between the magnetic energy
density and the cosmic microwave energy density during inflation, in order to
explain the present value $r\simeq 1$, showing that, in the slow-roll
approximation, power-law teleparallel theories with $B^{n}$ have effects
indistinguishable from metric theories $R^{n}$ where $R$ is the Ricci curvature
scalar..
