Thermodynamics of hidden Markov processes