Is there a general formalized method to define the homomorphism (structure preserving map) of a structure? 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.
 A: I expect there will be people who will even the following very general view on what amounts to a "conditions on a map that makes it structure preserving": 
Given a definition of thing deemed the "structure" (in your example, those are groups and topologies), if you now consider a class that holds all instances of this kind as objects, then whenever you can extend this to a category with at least 3 arrows connecting 3 different objects within it, then these arrows are a "structure preserving maps". 
By the axioms required of a category, those arrows here fulfil some algebraic relation rending one of the arrows $h$ expressible as $g\circ f$. As such, your object take on the character of an algebraic structure. 
I see this as one "universally applicable method". Although addmittedly, for mere cardinals as object, this is quite a void notion of structure preservation.

As a side note, there's a very great 400 page history study of "structure" called Modern-Algebra-Rise-Mathematical-Structures by Leo Corry, covering "Algebra" between Galois and Grothendieck. 
Here, since this covers over a century, you can see that "Algebra" as a subject is subject to evolution. And its conceptualizations were always subject to revision as well.
