In this question I'm primarily concerned with the workings of a set theory that lacks both Foundation and Choice.
Given a set $X$ and a function $\sigma:\mathcal{P}(X)\to\mathcal{P}(X)$, we have a notion of $\sigma$-closed subset as those $A\subset X$ such that for all $B\subset A$ we have $\sigma(B)\subset A$; every subset of $B\subset X$ then has a closure as the intersection of all the closed subsets that include $B$, which I'll denote $\overline{B}$.
Potentially, there's an obvious way to assign a notion of "$\sigma$-rank" to the members of $\overline{\emptyset}$ by setting up a transfinite sequence $\gamma$ such that $\gamma_\alpha=\bigcup(\gamma``\{\beta:\beta<\alpha\})\cup\bigcup\left(\sigma``\mathcal{P}\left(\bigcup(\gamma``\{\beta:\beta<\alpha\}\right)\right)$. Once the sequence hits $\overline{\emptyset}$ it should simply start repeating, and the rank of an element in $\overline{\emptyset}$ can be taken to be the least $\alpha$ in which it is a member of $\gamma_\alpha$.
However, I am unable to persuade myself, if $X$ cannot be wellordered, that I can count on this sequence to hit $\overline{\emptyset}$. Is there a way to show that this $\gamma$ will run into this intended closed set without being able to wellorder $X$? If so, does this hold up if there is no guarantee of a wellorder that can't inject into $X$ (i.e. if Hartogs' theorem fails)?
In ZF: You can define the $\sigma$-rank of a member of $X$ as the first $\alpha$ at which it shows up in $\gamma_\alpha$ if it ever does, and $0$ otherwise. Replacement then gives you a set of all $\sigma$-ranks of members of $X$.
Every set of ordinals has an upper bound (due to Burali-Forti), so you can safely stop the iteration when you reach that upper bound.
The crucial fact in this construction is that the formula you plug into the Axiom of Replacement is allowed to contain unrestricted quantifiers over all $\alpha$. So even though the entire $\gamma_\alpha$ sequence does not exist as a single object, you're still allowed to ask whether there's one of the $\gamma_\alpha$ sets that contains your target element.
I'm not experienced enough with NF(U) to tell whether this argument will work there.