A two-step sequential approach for hyperparameter selection in finite context models