Of course it is not the case that natural transformations $\mathscr{C}(A,-)\Rightarrow F$ form a class because natural transformations are functions between classes $Obj(\mathscr{C})\to Mor(\mathbf{Set})$, i.e. certain subclasses of the class of pairs $Obj(\mathscr{C})\times Mor(\mathbf{Set})$, hence cannot be members of a class.
The Yoneda lemma asserts, however, that there is a (natural) bijective correspondence between natural transformations $\mathscr{C}(A,-)\Rightarrow F$ and elements of the small class $F(A)$. Accordingly, we define $Nat(\mathscr C(A,-),F)$ to be the class $F(A)$.
More generally (and this applies also in the case where the category $\mathscr C$ is not locally small), you should think of $\mathscr C(A,-)$ as a class-valued copresheaf (which is roughly a family of classes indexed by the objects of $\mathscr C$ equipped with a "functorial" action of the morphisms of $\mathscr C$). Then the Yoneda lemma asserts that given another class-valued copresheaf $F$, there is a (natural) bijective correspondence between morphisms of copresheaves $\mathscr C(A,-)\Rightarrow F$ and elements of the class $F(A)$.
Thus the Yoneda lemma allows you to realize as a class the a priori "metaclass" of morphisms from a representable class-valued copresheaf on a (not necessarily locally small) category.
What is usually called the Yoneda lemma is the exact same argument but with $F$ restricted to being a class-valued presheaf valued in small classes, i.e. a functor to $\mathbf{Set}$ instead. But there is no difference in the proofs and you might as well use the more general statement to define the class of natural transformations; then it's by definition that it's a set for a set-valued copresheaf (i.e. functor to $\mathbf{Set}$).
More generally still, this is a special case of the Yoneda lemma for fibrations, which should be thought of as well-behaved category-valued (weak) copresheaves on the $\mathscr C$ given its natural structure (via the arrow category $\mathscr C^\to$) as a category internal to the "metacategory" of (possibly large) categories. The Yoneda lemma for fibrations is slightly different and gives a realization as a category of the "metacategory" of morphisms only up to equivalence because fibrations are weak copresheaves.