Two-Stage Bayesian Optimization for Scalable Inference in State-Space Models