The mechanical power produced at the armature of a motor is: P = Ta .
(power is in watts if torque is N.m and in rad/sec).
Some of this will be lost due to friction and air resistance ('windage'). The remainder is available as mechanical output power.
This leads to two Torque definitions:
Ta is the so-called 'air-gap torque' produced by the armature
Ts is the 'shaft torque' that is available to drive the mechanical load
The difference is that lost due to friction, windage etc.
The input electrical power that is converted to mechanical power at the armature is that due to the product of the back emf and the armature current.
Note that e is smaller than the applied voltage, V.
In addition to mechanical losses (friction etc), some electrical power is dissipated in the armature resistance and field coil resistance. (In an ac motor, other losses occur due to magnetisation and eddy current losses).
Hence, for a shunt connected motor:
Ta. = e . Ia = (V - Ia.Ra) . Ia
while for a series connected motor:
Ta. = e . Ia = [V - I.(Ra + Rf)] . I