How do we tell which part of kinetic energy gives rise to temperature? I know that macroscopic temperature is a measure of kinetic energy of particles at very low scales (let's call it microscopic kinetic energy).
But how can we derive which part of this microscopic kinetic energy gives rise to temperature, and which part instead gives rise to macroscopic kinetic energy?
 A: 
I know that macroscopic temperature is a measure of kinetic energy of particales at very low scales (let's call it microscopic kinetic energy).

This is not generally true. The only case where this is true is for an ideal monoatomic gas. For all other materials there are more internal degrees of freedom than merely the kinetic energy. 
For the remainder of your question, to determine which portion of the total energy is due to which parts, you have to distinguish between internal and external degrees of freedom. Then the thermal energy is the portion of the total energy contained in all internal degrees of freedom and the kinetic energy is the portion contained in the external rotation and translation degrees of freedom. 
A: The macroscopic kinetic energy of a system of particles is the kinetic energy due to the velocity of the center of mass of the collection of particles with respect to an external frame of reference.
For example suppose you have a container filled with an ideal gas. The temperature of the gas is a measure of the average kinetic energy of the randomly moving gas particles. That is its internal kinetic energy.
Let the container be moving at constant velocity with respect to an external frame of reference (e.g., the room where the container is located). The external (macroscopic) kinetic energy of the gas in the container is $\frac{mv^2}{2}$ where $m$ is the mass of the gas and $v$ is the velocity of the container with respect to the room. This kinetic energy is independent of the internal kinetic energy, not a part of it.
The total kinetic energy of the gas is the sum of its internal and external kinetic energies.
Hope this helps. 
A: À heat engine is a device for converting heat energy into mechanical energy.  Conceptually, the situation can be seen as interacting perfectly elastic spheres, like billiard balls. An accurate description of the system would involve Van der Waals forces, internal degrees of freedom for poly atomic gases and quantum effects but all these are secondary to the answer to the question.
Consider the cylinder of a heat engine. One wall can move, a piston. The pressure the piston feels is due to the momentum transfer of the molecules within a mean free path and whose momenta have components normal to the piston. It is the concerted effort of these molecules that causes the total force on the connecting rod behind the piston. When the piston moves, energy (F.ds) is extracted from the gas and the gas cools. In effect the heat engine sorts out molecules that have a common direction and converts some of their heat energy to work. 
