A Semiparametric Transition Model with Latent Traits for Longitudinal Multistate Data