Kwai-STaR: Transform LLMs into State-Transition Reasoners