Taiwanese here, let me break this down for you.
Is the ROC of today the same as the KMT that fled Mainland China after
the Chinese Civil War?
The short answer is no.
While the name of ROC (Republic of China) remains the same to this day, in real terms, the polity had underwent significant internal transformation since 1997. Notably:
The country ROC (now more commonly called "Taiwan" both internationally and domestically) is no longer a colonial authoritarian regime, but rather a liberal democracy, largely due to sustained civic activism.
The KMT (Kuomingtang) is no longer synonymous with the country itself, in fact, the ruling party for the past eight years has been DPP (Democratic Progressive Party). They are now the two major parties in a competitive political landscape both nationally and locally. To this day, there has been three peaceful transitions of power.
The political system has been modified to the extent that it is a pretty far departure from the original ROC. For example, the bicameral system was abolished in favor of unicameral system, the President is now popularly elected rather than by the (now non-existent) upper house, the "Province" system is no longer in use, etc.
How did [ROC] stay intact under Imperialist Japanese Rule?
The ROC took over Taiwan at the same time when Imperial Japan left Taiwan. There was a negotiated handover process where one regime leaves as the next one enters.
The transition was so notable that it was widely documented in movies and books. For example, there was a famous movie called Cap No. 7 where a modern mailman is tasked to deliver a love letter from Japan to a now defunct address in Taiwan, which chronicals two lovers who were separated because the Japanese guy has to leave while the Taiwanese girl has to stay amidst the backdrop of the handover.
Most Taiwanese at the time consider themselves Japanese the same way Commonwealth people consider themselves "British". This sets the stage for decades of ethnic tension where Taiwan struggles to form its own identity, one side (pan-blue coalition) advocates a return to ethnic nationalism based on Chinese identity, while the other side (pan-green coalition) advocates for a kind of civic nationalism based on Taiwanese identity.
In real terms, Taiwan has gone through basically three stages of transformation:
Japanese colonial rule
ROC colonial rule
Liberal democracy
In my opinion, a lot of people mistake Tawian as still being in Stage 2, when in fact we are already at Stage 3.