  Elliptical galaxies today appear aligned with the large-scale structure of
the Universe, but it is still an open question when they acquire this
alignment. Observational data is currently insufficient to provide constraints
on the time evolution of intrinsic alignments, and hence existing models range
from assuming that galaxies gain some primordial alignment at formation, to
suggesting that they react instantaneously to tidal interactions with the
large-scale structure. Using the cosmological hydrodynamical simulation
Horizon-AGN, we measure the relative alignments between the major axes of
galaxies and eigenvectors of the tidal field as a function of redshift. We
focus on constraining the time evolution of the alignment of the main
progenitors of massive $z=0$ elliptical galaxies, the main weak lensing
contaminant at low redshift. We show that this population, which at $z=0$ has a
stellar mass above $10^{10.4}$ M$_\odot$, transitions from having no alignment
with the tidal field at $z=3$, to a significant alignment by $z=1$. From
$z=0.5$ they preserve their alignment at an approximately constant level until
$z=0$. We find a mass-dependence of the alignment signal of elliptical
progenitors, whereby ellipticals that are less massive today ($10^{10.4}<M/{\rm
M}_\odot<10^{10.7}$) do not become aligned till later redshifts ($z<2$),
compared to more massive counterparts. We also present an extended study of
progenitor alignments in the parameter space of stellar mass and galaxy
dynamics, the impact of shape definition and tidal field smoothing.
