I'm not saying it's an n-gram Markov model or that you should store them as a lookup table. Markov models are just a mathematical concept that don't say anything about storage, just that the state change probabilities are a pure function of the current state.
You say state can be anything, no restrictions at all. Let me sell you a perfect predictor then :) The state is the next token.