Let me give the relative construction. We'll say our geometric objects are presheaves on some category $Aff$, and we'll denote sheaves of categories by $2QCoh(-)$.
There's a functor
$$P(Aff)_{/B}^{op} \to 2QCoh(B)$$
$$(f: X \to B) \mapsto Perf(X)$$ sending a presheaf over $B$ to a $Perf(X)$ viewed as a sheaf of categories over $B$, via $f^*$. One shows that this preserves limits, and the right adjoint $M_{(-)/B}$ is a relative moduli of objects, as a presheaf over $B$.
As in the absolute case we have an explicit formula
$$M_{C/B}(Spec(R) \to B) \simeq Map_{2QCoh(B)}(Perf(R), C)$$
where in the first argument on the RHS, $Perf(R)$ is endowed with the structure of a sheaf of categorycategories over $B$ via the map $Spec(R) \to B$. And of course $B= *$ case recovers the absolute case.
I expect arguments of Antieau-Gepner about representability of moduli generalize to this relative setting, though I do not have a precise statement at the moment.
Footnote: As you do in the question statement I'm sweeping some presentability issues under the rug here to give the idea, $2QCoh(-)$ needs to be constructed carefully, but sounds like you know where to look for these constructions.