In this MO answer, I was told the definition of principal bundle as a homotopy fiber of its classifying map precisely says that it's the universal bundle which trivializes itself.
However, I'm having a hard time actually making this explicit, i.e how exactly to move from "it is the universal map to $B$ such that the composition with $f$ is equipped with a nullhomotopy", to "$E$ is the universal space over $B$ equipped with a trivialization of the pullback of the principal bundle to $E$"?
Where to use homotopy invariance?
You trivialize $E\times_B E\to E$ using exactly the nullhomotopy of $f\circ p:E\to BG$. For this you need to know that principal $G$-bundles over $X$, up to isomorphism, are in bijection with maps $X\to BG$, up to homotopy, and that given $f:X\to BG$ classifying $q:Z\to X$ and a map $g:Y\to X,f\circ g$ classifies $Z\times_X Y\to Y$. The first fact is proven wherever principal $G$-bundles are defined. The second fact follows from the cancellation lemma for pullbacks and the construction of the bundle classified by a map into $BG$ as the pullback with $EG$ over $BG$: in the earlier notation, $q$ is the projection $X\times_{BG} EG\to X$, $f\circ g$ classifies $Y\times_{BG}EG\to Y$, and by pullback cancellation $Y\times_{BG}EG= Y\times_X X\times_{BG} EG$. Now returning to $E$ and $B$, since the nullhomotopy of $f\circ p$ was universal, so is the trivialization of $E\times_B E\to E$.