Abstract:
Let $K$ be an abstract class of groups such that a countable group $U$ exists possessing the following properties: 1) an arbitrary finitely generated subgroup of $U$ belongs to $K$; 2) an arbitrary finitely generated subgroup from $K$ is imbedded in $U$; 3) a recursive representaion of the group $U$ exists with a solvable word identity problem.
Then for arbitrary $n\ge1$ there exists $\exists\forall$-equation $\Psi_n(v_0,\dots,v_{n-1})$ such that for an arbitrary algebraically closed group $G$ and for arbitrary $x_0,\dots,x_{n-1}\in G$ $$
(x_0,\dots,x_{n-1})\in K\Leftrightarrow G\vDash\Psi_N(x_0,\dots,x_{n-1}).
$$
Classes of finite free nilpotent groups satisfy the conditions of the theorem.