My notes say that electrical energy and power consumed by a resistor is totally transformed to heat energy.
Is this true?
Or could it be transformed into also some other kind of energy?
If you run the resistor hot enough, some of the energy will be converted to light rather than heat. Although it is probably converted from electrical energy to heat, and then the thermal vibrations of the material generate light, so it's not a direct conversion from electrical to light.
This is exactly how incandescent light bulbs work.
If you want an example of a direct conversion from electrical to light, then you can argue that an LED is a type of nonlinear resistor, and that it really does convert the energy of a pair of charge carriers in an electrical potential to light through the radiative recombination process.
It is converted mostly to conducted, convection-transmitted, and radiated heat. The latter has a wavelength peak typically described by Planck's Law. For most resistors, operated within their design limits, that wavelength is in the infrared region. Our eyes are not designed to see that wavelength (they are optimized for the radiation peak of our sun) but you may be able to feel it on your skin at a distance (or see it on an IR camera such as a FLIR). If the resistor gets hot enough there may be visible radiation of deep red, red, yellow, white etc. for increasing temperature.
Resistors also have some inductance (especially certain types of wirewound resistors) which means that some energy is stored in the magnetic field, proportional to the square of the current.
There would also be some small amount of energy stored in capacitance, proportional to the voltage across the resistor squared.
The latter two energy storage mechanisms are due to parasitic effects. Resistors are usually designed to minimize those effects.
There may also be energy stored in changes in the materials used. For example, mechanical forces and possibly phase changes such as glass transition temperature.
Have AC current. Some radiowaves will be spred to free space. The amount of radiation can be substantial if the resistor happens to have big enough mechanical dimensions. Actually that energy isn't consumed by the resistor, the wave exists already around the wires before reaching the resistor, it only helps the wave to jump out, if the geometric shape of the resistor breaks the transmission line geometry and works like an antenna.
But if you measure the voltage and current at the terminals of a resistor and calculate the AC power, the radiated part is included to the calculated power.
Since every resistor has parasitic inductance and capacitance, some of the electric field will be lost to free space. Since for a through hole part. This will be in the nH range and the pf range for capacitance, it will usually be ignored