Long-Term Latent Dynamics And Cortical Interactions In A Dynamic Bandit Task