The producers make food by the help of the process known as photosynthesis.This is the way by which the energy from the sun is transferred from sun to the plants.
Matter is made and transferred from one tropic level to another tropic level. The organic matter is transferred from the producers to the consumers.
The primary consumer converts energy from them to the secondary consumers.
So, the conclusion is that matter and energy is transferred from one tropic level to another tropic level.
Nitrogen fixation, N2 --> NH3+, is not something that plants to by themselves but some plants have bacteria that does this. I believe that pea plants have these, but I'm not 100% sure.