Solution (source code)

= Solution

Fix a set $x$ and define by recursion on $\omega$
$$
T_0=x,
\qquad
T_{n+1}=\bigcup T_n.
$$
The recursion theorem defines a function-class $F$ uniquely by $F(n)=T_n$: for each $n\in\omega$ there is exactly one finite sequence satisfying the displayed recursion through stage $n$. Thus $F$ is genuinely functional, and the <Axiom schema of replacement> applied to the set $\omega$ gives the set $\{T_n:n\in\omega\}$.

Now define
$$
T=\bigcup_{n\in\omega}T_n.
$$
It contains every member of $x$. If $y\in T$, then $y\in T_n$ for some $n$; hence every $z\in y$ belongs to
$$
\bigcup T_n=T_{n+1}\subseteq T.
$$
Thus $T$ is transitive. If $U$ is any transitive set containing every member of $x$, induction gives $T_n\subseteq U$ for every $n$, so $T\subseteq U$. Therefore
$$
\boxed{T=\operatorname{TC}(x)}
$$
is the <transitive closure> of $x$.