Automated Analytic Asymptotic Evaluation of the Marginal Likelihood for Latent Models