The sprocket must be mounted perfectly centered & have no side to side wobbles!!!
Then, the chain tensioner must feed the chain straight on to the sprocket so that the chain doesn't snag the teeth & jump off.
Spin the wheel & watch what the sprockets doing.