While looking at this question I suddenly wondered about a more general question.
Think of your favorite class of algebra (groups or rings, say), and forgive me for vocabulary mistakes while I try to frame an unfamiliar question.
For an algebra $A$, we have conditions with variables and/or parameters, written as $\phi$.
For what $\phi$ does $\{x\in A \mid \phi(x)) \}$ always form a subalgebra?
In the question I linked, the poster was asking about $\phi(x,a)$ being the condition $xa=ax$ for a fixed $a$ in a monoid.
The condition $\phi(x)$ could also be something like $\forall y\in A(xy=yx)$. For another example, $\forall y\in A(xy=0)$ is another such identity in monoids with an absorbing element $0$ (like in the monoid of a ring).
On one hand I wouldn't be surprised if universal algebraists had this figured out, but on the other hand it seems like a pretty general question. The conditions are somewhat like "identities," but of course they vary wildly and don't apply to the whole object.
I'd be interested in hearing about whatever is known!
Brief update: I think I am most interested in the conditions that are like polynomials ( not arbitrarily wild conditions). Hopefully there is a difference between the two!
Last update, hoping to narrow the question enough:
Are the usual conditions we care about (ex. centralization, normalization, annihilation) special in an intrinsic way that sets them apart from generic conditions?