Classification under Nuisance Parameters and Generalized Label Shift in Likelihood-Free Inference