  We introduce a novel technique for constraining cosmological parameters and
galaxy assembly bias using non-linear redshift-space clustering of galaxies. We
scale cosmological N-body simulations and insert galaxies with the SubHalo
Abundance Matching extended (SHAMe) empirical model to generate over 175,000
clustering measurements spanning all relevant cosmological and SHAMe parameter
values. We then build an emulator capable of reproducing the projected galaxy
correlation function at the monopole, quadrupole and hexadecapole level for
separations between $0.1\,h^{-1}{\rm Mpc}$ and $25\,h^{-1}{\rm Mpc}$. We test
this approach by using the emulator and Monte Carlo Markov Chain (MCMC)
inference to jointly estimate cosmology and assembly bias parameters both for
the MTNG740 hydrodynamic simulation and for a semi-analytical galaxy formation
model (SAM) built on the MTNG740-DM dark matter-only simulation, obtaining
unbiased results for all cosmological parameters. For instance, for MTNG740 and
a galaxy number density of $n\sim 0.01 h^{3}{\rm Mpc}^{-3}$, we obtain
$\sigma_{8}=0.799^{+0.039}_{-0.044}$ ($\sigma_{8,{\rm MTNG}} =$ 0.8159), and
$\Omega_\mathrm{M}h^2= 0.138^{+ 0.025}_{- 0.018}$ ($\Omega_{\mathrm{M}}
h^2_{\rm MTNG} =$ 0.142). For fixed Hubble parameter ($h$), the constraint
becomes $\Omega_\mathrm{M}h^2= 0.137^{+ 0.011}_{- 0.012}$. Our method performs
similarly well for the SAM and for other tested sample densities. We almost
always recover the true amount of galaxy assembly bias within one sigma. The
best constraints are obtained when scales smaller than $2\,h^{-1}{\rm Mpc}$ are
included, as well as when at least the projected correlation function and the
monopole are incorporated. These methods offer a powerful way to constrain
cosmological parameters using galaxy surveys.
