A method to control an electric motor of a hydraulic system of a transmission in a vehicle; the hydraulic system comprises a circulation pump allowing a lubricant oil to circulate, and/or an actuation pump providing the hydraulic pressure needed to operate the transmission, a carrier shaft on which the pumps (23, 24) are mounted, and the electric motor designed to cause the rotation of the carrier shaft; the control method comprises the steps of: determining a requested torque (Req_Torque) to be applied by the electric motor to the carrier shaft; determining a requested rotation speed (Req_Speed) to be imparted by the electric motor to the carrier shaft; controlling the electric motor so as to pursue the requested torque (Req_Torque) and the requested rotation speed (Req_Speed); determining a target oil pressure (System_Pressure_Tgt); determining a torque (Pump_Needed_Torque) needed by the pump based on the target oil pressure (System_Pressure_Tgt); determining the requested torque (Req_Torque) based on the torque (Pump_Needed_Torque) needed by the pump; determining a target oil flow rate (Flow_Tgt) for an adequate lubrication; and determining the requested rotation speed (Req_Speed) based on the target oil flow rate (Flow_Tgt); the control method is characterized in that it comprises the further steps of: calculating a speed error by subtracting the actual rotation speed (Act_Speed) from a requested rotation speed (Req_Speed); determining a sustenance torque (CL_Torque) based on the speed error by means of a PID controller; determining a friction torque (Friction_Torque) based on the actual rotation speed (Act_Speed) and on an inner temperature (Motor_Temp) of the electric motor; and calculating a target torque (Tgt_Torque) by adding the sustenance torque (CL_Torque), the friction torque (Friction_Torque) and the requested torque (Req_Torque) to be delivered by the electric motor to the carrier shaft. determining a requested torque (Req_Torque) to be applied by the electric motor to the carrier shaft; determining a requested rotation speed (Req_Speed) to be imparted by the electric motor to the carrier shaft; controlling the electric motor so as to pursue the requested torque (Req_Torque) and the requested rotation speed (Req_Speed); determining a target oil pressure (System_Pressure_Tgt); determining a torque (Pump_Needed_Torque) needed by the pump based on the target oil pressure (System_Pressure_Tgt); determining the requested torque (Req_Torque) based on the torque (Pump_Needed_Torque) needed by the pump; determining a target oil flow rate (Flow_Tgt) for an adequate lubrication; and determining the requested rotation speed (Req_Speed) based on the target oil flow rate (Flow_Tgt); the control method is characterized in that it comprises the further steps of: calculating a speed error by subtracting the actual rotation speed (Act_Speed) from a requested rotation speed (Req_Speed); determining a sustenance torque (CL_Torque) based on the speed error by means of a PID controller; determining a friction torque (Friction_Torque) based on the actual rotation speed (Act_Speed) and on an inner temperature (Motor_Temp) of the electric motor; and calculating a target torque (Tgt_Torque) by adding the sustenance torque (CL_Torque), the friction torque (Friction_Torque) and the requested torque (Req_Torque) to be delivered by the electric motor to the carrier shaft. calculating a speed error by subtracting the actual rotation speed (Act_Speed) from a requested rotation speed (Req_Speed); determining a sustenance torque (CL_Torque) based on the speed error by means of a PID controller; determining a friction torque (Friction_Torque) based on the actual rotation speed (Act_Speed) and on an inner temperature (Motor_Temp) of the electric motor; and calculating a target torque (Tgt_Torque) by adding the sustenance torque (CL_Torque), the friction torque (Friction_Torque) and the requested torque (Req_Torque) to be delivered by the electric motor to the carrier shaft.