Let $\mathcal{M}, \mathcal{N}$ be two "well-behaved" (i.e. representable by an algebraic stack parametrising flat, proper, surjective, finitely presented morphisms with geometric fibres being the objects of interest) moduli problems. As an example you can have $\overline{\mathcal{M}}_g$ in mind.
I am interested in a moduli stack parametrising morphism between these objects, so the $S$-points for a scheme $S$ should consist of triples $(M,N,f)$ with $M \in \mathcal{M}(S), N \in \mathcal{N}(S)$ and $f: M \to N$ be a morphism over $S$. If such a stack exists, then there are many locally closed substacks, i.e. finite morphisms of given degree, etc. of general interest (at least to me).
Jack Hall and David Rydh give in arxiv:1011.5484 the following theorem:
Let $X \to S$ be a morphism of algebraic stacks that is locally of finite presentation, with quasi-finite and separated diagonal. Let $Z \to S$ be a morphism of algebraic stacks that is proper, flat, and of finite presentation with finite diagonal. Then the $S$-stack $T \to \operatorname{Hom}_T (Z \times_S T, X \times_S T )$ is algebraic, locally of finite presentation over S, with quasi-affine diagonal over $S$.
I think that considering the universal families $\mathcal{UM} \to \mathcal{M}$ and $\mathcal{UN} \to \mathcal{N}$ by constructing the stack \begin{align*} \mathcal{HOM}_{\mathcal{M} \times \mathcal{N}}(\mathcal{UM} \times \mathcal{N}, \mathcal{UN} \times \mathcal{M}) \end{align*}
I can solve the moduli problem as the universal families by definition fulfill all necessary properties.
However, I think it is surprising that I cannot find this very general construction anywhere in literature, so I would be happy if an expert on stack theory can tell me whether my construction is correct or if there is a mistake.