I need to show that there is a finite conjunction $\phi$ of axioms of ZF, such that whenever $M$ is a transitive proper class satisfying $\phi$, $M$ satisfies all the axioms of ZF.
I read from a previous post that we should use the reflection principle but I did not understand the post. How do I show the above?
I think you should be giving us more help helping you (not just on this question) but I appreciate that this is hard and JDH's answer might not be easy to follow... I certainly don't think I understood it the first time I read it, a year or two ago, even though I had already done the exercise (probably incorrectly). So I'll try to give something more detailed.
I gather from this and your other questions that you are probably using Kunen's book (the older one). This exercise occurs after another one that asks to show that a transitive proper class $M$ is a model of ZF if and only if it satisfies separation and is almost universal, where almost universal means that for any $x\subset M$ that is a set, there is a $y\in M$ such that $x\subset y.$ If we have done this problem already, then all we need to do is show is that separation and almost-universality can be enforced by $M$ satisfying a finite number of axioms.
In fact, there is really not a lot we need from the other problem. Observe that the only axioms we need to establish in $M$ are the infinite schemes of separation and replacement: anything else we could just include from the get-go. So we just need the argument that almost-universality and separation imply replacement. Let $F:X\to M$ be a definable class function in $M$ where $X\in M.$ Then since the range $F''(X)$ is a set (by replacement in $V$) and $F''(X)\subset M,$ almost universality says there is a $Y\in M$ such that $F''(X)\subset Y.$ This gives us Kunen's weaker version of replacement immediately (which can be combined with separation in the standard way to imply the usual version).
So we are done once we establish that almost-universality and separation can be enforced by finitely many axioms holding in $M$. For almost-universality, let's take enough axioms to give us absoluteness of rank for the transitive class $M$, i.e. enough axioms to define the cumulative hierarchy and prove every set belongs to it. Note that absoluteness of rank means that $V_\alpha^M=V_\alpha\cap M$ for any $\alpha\in M.$ Let $x$ be a set such that $x\subset M,$ Since $x$ is a set, $x\subset V_\alpha$ for some $\alpha$, and since $x\subset M,$ $x\subset V_\alpha\cap M=V_\alpha^M\in M.$ So $M$ is almost universal. (In his answer, JDH combined this step and the proof of replacement/collection in the previous paragraph.)
(Note that the place where we used that $M$ is a proper class was when we assumed $\alpha \in M.$ Note that since the rank function is defined (and absolute) and $M$ is a proper class and hence contains sets of arbitrarily large rank, $M$ contains arbitrarily large ordinals, and then since it is transitive, it contains all ordinals.)
For separation, we must show for any $\vec p,X\in M,$ and formula $\varphi,$ $$\{x\in X:\varphi^M(x,X,\vec p)\}\in M.$$ Let $\alpha$ large enough so that $\vec p,X\in V_\alpha.$ By the reflection theorem for the hierarchy $V_\alpha^M$, there is a $\beta>\alpha$ such that for all $x,X,\vec p\in V_\beta^M,$ $$ (\varphi^M(x,X,\vec p)\leftrightarrow \varphi^{V_\beta^M}(x,X,\vec p)).$$ So we have $$\{x\in X:\varphi^M(x,X,\vec p)\}=\{x\in X:\varphi^{V_\beta^M}(x,X,\vec p)\}\in \operatorname{Def}(V_\beta^M),$$ where $\operatorname{Def}(V_\beta^M)$ is the set of parameter-definable subsets of $V_\beta^M.$ So we just need enough axioms for $M$ to define the operation $\operatorname{Def}(A)$ and to guarantee its absoluteness for $M$, i.e. whatever is used in definition 1.1 and lemma 1.7 in Kunen.
(JDH hints at this reflection argument to reduce to the case of $\Delta_0$-separation, which can be finished off something similar to the argument I gave. I'm not completely sure, but I think the "or much less if you care to optimize" refers to the fact that you can get $\Delta_0$-separation for a transitive class from assuming it is closed under several elementary set operations called Godel operations: a good source for this is Jech's chapter on the constructible hierarchy. It turns out a transitive proper class is a model of ZF if and only if it is almost universal and closed under Godel operations.)