How do we store state of the state machine?

The transition function gives us access to state.