There is no such mapping in general. In your example where $Y$ is a point, you would like to extend $X \mapsto \operatorname{Sym}(X)$, the symmetric group, to a functor $S:\operatorname{Set} \to \operatorname{Group}$. Suppose there is such an $S$. Choose $X_1$ and $X_2$ with $|X_1| = 4$ and $|X_2| = 5$, and choose maps $f: X_1 \to X_2$ and $g: X_2 \to X_1$ with $g \circ f = 1$. The only nontrivial proper normal subgroup of $\operatorname{Sym}(X)$ is the alternating group when $|X| \ge 5$, so there are no onto homomorphisms $\operatorname{Sym}(X_2) \to \operatorname{Sym}(X_1)$. So $S(g)$ is not onto, and $S(g \circ f)$ is not onto. But $S(g \circ f) = S(1_{X_1}) = 1_{S(X_1)}$, so this is impossible. So there is no such $S$.