> IMO a state machine should be define first in a list of valid state transitions.
I once did this for a project and I really regretted it, when the state machine grew to ~15 states with maybe 80% of the complete graph in terms of transitions, it became extremely hard to read and follow as one would need to jump back and forth all over the place in the code
Perhaps something like this: