Let $\mathcal{C}$ be a (locally) small category and let $F \colon \mathcal{C} \to \bf{Set}\hspace{1mm}$ be a functor, then we say that $F$ is representable if there is a natural isomorphism between $F$ and $\textrm{Hom}_{\mathcal{C}}(A, -)$ for some object $A \in \mathcal{C}$. In this case, we say that the object $A$ ''represents'' the functor $F$.
A consequence of the Yoneda Lemma is that this object $A$ that represents a given functor $F$ is unique up to isomorphism (to prove this, either just appeal to the Yoneda embedding or see the comments for a direct approach). This is precisely what was used in the link you referenced: the only way the functors $\textrm{Hom}(f^* \mathcal{M} \otimes_{\mathcal{O}_X} f^* \mathcal{N}, -)$ and $\textrm{Hom}(f^*(\mathcal{M} \otimes_{\mathcal{O}_Y} \mathcal{N}), -) \hspace{1mm}$ can be naturally isomorphic is if the first arguments themselves are isomorphic.