What is the formal way to define "class" in ZFC?

You can formally define classes in the meta-theory.

If the meta-theory is a set theory, then you can think about the universe $V$ of sets as just a set model in the meta-theory's universe. In that case a class is just a definable (with parameters) subset of $V$.

If the meta-theory is some arithmetic theory, or otherwise incapable of expressing semantics as sets (meaning that we work syntactically with $\sf ZFC$ and proofs, rather than taking a model of set theory and so on), the a class is really just a formula which has possible parameters, and we say things like "The relativization of the axioms of $\sf ZFC$ to the class defined by this formula is provable from the axioms of $\sf ZFC$" (with the additional quantifiers about parameters when needed, e.g. there is a choice of parameters such that ... or for every choice of parameters ...)


Assuming an inaccessible cardinal makes things easy because it gives us a set universe which agrees with the meta-theory's universe about the power set operation, something which is not to be underestimated. But of course we can do with much much much less than that. Any set model of $\sf ZFC$ will do, it doesn't even have to be a well-founded one.