Unlikely intersections in families of abelian varieties and the polynomial Pell equation