Let $M, \tilde M$ be Riemannian manifolds and $f: M \rightarrow \tilde M$ be an immersion. I have seen that given the Levi-Civita connection $\tilde \nabla$ on $M$, one naturally obtains a connection $\hat \nabla$ in the pullback bundle $f^* T \tilde M$ over $M$. Indeed, for any $Z \in \Gamma(T \tilde M)$ and any $X \in \Gamma(TM)$, we put: $$ \hat\nabla_X (f^* Z):= \tilde\nabla_{f_* X}(Z) $$ This definition makes sense because a conneciton only depends on the pointwise value of the lower argument, so it doesn't have to be the case that $f_* X$ is a well defined vector field, as long as it gives a vector for each point of $M$.
However, I have seen the following notation, which I am trying to make sense of: $$ \hat\nabla_X (f_* Y), \quad X, Y \in \Gamma(TM)$$ How do I make sense of this? $f_* Y$ is not defined outside the image of $f$, so to apply the connection to it, we would have to pick an extension to a vector field on $\tilde M$, but since the connection $\tilde\nabla$ depends on the value of a vector field on an open set around a point, what guarantees that the result would be independent of the extension?
EDIT: I am now thinking that my question amounts to this: How can we see $X \in \Gamma(TM)$ as a section of $f^* T\tilde M$ (as we intuitively think we should be able to), under the obstruction that $f_* X$ is not a section of $T \tilde M$?