The motor shaft is connected to a flywheel which is rotated manually to achieve a certain speed. Now when motor is switched on, how will it impact the shaft? Will motor whole power goes into increasing the torque on shaft in initial cycles as it can't increase the speed of shaft abruptly due to flywheel.
If by "abrupt" you just mean too fast for human senses to notice then that is an inappropriate measure by which to judge things here. I'm going to define abrupt as a step change in RPM or velocity. That means that there is no mathematically abrupt change in RPM anywhere since the change must be continuous, even if that means asymptoptic.
This isn't any different from just turning the flywheel directly, or even just turning the shaft without the flywheel. The shaft on its own has inertia and the flywheel obviously has inertia. So whenever you apply torque to accelerate something that thing is going to deform under torsion, even if it was just a shaft with no flywheel.
You can't apply torque to the shaft, deform it under torsion, and accelerate it without also doing the same three things to the flywheel. There is no "all the power goes into increasing torque on the shaft" without doing the same to the flywheel.