What's happening when a force is applied but there's no displacement? I've thought of an example that can explain my doubt properly.
Let's take an electric motor which is connected with an object through a rope so that when the motor starts to rotate, it brings the object towards itself. However, the mass of the object is such that the motor can't move the object.
So, the moment I switch on the motor, Electric energy is given to it but does not produce any displacement of the object, and therefore, it doesn't do any work. Since energy is given to the motor, in what form is it transformed? What's happening inside the motor considering that it's not doing work?
I hope I explained properly the problem and I'm grateful to whoever will be able to clear up my doubt! 
 A: I do apologize for not simply commenting, as I am not able to do so, but I found this answer to a different question that explains why a motor releases heat energy when held stationary. Again, apologise for not really giving any original answer, but thought this would help.
A: Assume that it is a simple dc motor.  
The instant you switch the motor on a current $I$ will flow through the coil and a torque will be produced on the coil.
If the supply voltage is $V$ and the resistance of the coil is $R$ then the electrical power supplied by the supply is $VI$ and this is dissipated as heat in the coil if the motor $I^2R$.
If the coil was unable to move then this would be bad news for the motor as the heat generated might well be sufficient to melt the coil.
Once the coil starts to move then the voltage of the supply minus the (induced/back) emf produced by the coil rotating in a magnetic field $\mathcal E$  is equal to the voltage across the coil resistance $V -\mathcal E = IR$.
As the motor speed $\omega$ increases the induced emf increases because the $\mathcal E \propto \omega$.
So in terms of power $VI = \mathcal E I + I^2R$.
$VI$ is the power supplied the voltage source, $I^2R$ is the power  dissipated as heat in the coil and $\mathcal E$ is the power for the motor to do work eg useful power lift your mass and wasted power overcoming friction at the baring.
You will note that the current through the rotating coil is now lower than than when the coil was not moving.  
If you want the motor to do more work per second then the speed of rotation $\omega$ of the coil decreases and so the induced emf $\mathcal E$ decreases.  
However the important thing to note is that the fractional increase in current $I$ is greater than the fractional decrease in the emf $\mathcal E$ so the product $\mathcal E I$ (the power output of the motor) increases.
If you have ever used an electric drill you perhaps have noticed that when the drill is under load (eg drilling a hole) it is rotating slower than when the drill is under no load conditions.
