This is a follow-up to this question. There I asked for an intuition of what "structure preserving" means.
My question here is, is there a universally applicable method (given the objects that define a structure, and axioms defined on those objects) to find conditions on a map that makes it structure preserving (i.e. a homomorphism)?
For example,
monoid homomorphism. A map $f$ on monoids is a monoid homomorphism if $f(a\cdot b)=f(a)\cdot f(b)$ and $f(e)=e$.
topological homomorphism (homeomorphism). For any open set $U$, $f^{-1}(U)$ is also an open set.
While it is clear that these definitions are structure preserving if you first think hard about what monoids and topologies are, it is not clear to me how we could have derived that these are the correct definitions for the structures' homomorphisms, based on a universally applicable method.