Luck and lots of it. You have to have emperors who like the steam power and especially ones who like the people who research it in order to get a foot in the door.
Or additionally the bureaucracy may view the newfangled industrial revolution as cool, but unworthy of the Imperial Court's attention. Who cares about machines to burn coal and produce goods at much lower cost when eunuchs are busy with nasty plots? Before the Emperor has noticed, large workshops across the coal-rich parts of Northern China are absorbing the hordes of excess agriculture workers. The Ming and the early Qing economies were close to the definition of classical liberal.
These trading companies then create railways to reduce the cost of transporting goods, and lay telegraphs along them to enable instant communication of prices and company strategies. Initially these were for private usage, but slowly the trading groups realize transportation and communication as businesses in their own right.
However, once railways and telegraph massively shrink the size of the empire, the state will have no choice but to invest in an empire-wide network. If nothing else, all the feuding eunuchs want to strengthen control over the outlying provinces.
So, if the state neglects the development of these technologies until their importance of running the empire are obvious to even the most conservative mandarins, the Industrial Revolution is irreversible.