Self-learning Monte Carlo for non-Abelian gauge theory with dynamical fermions