Yes, energy transfer does take place even if the rock doesn’t move. When you push the rock with all your might, your muscular energy is not wasted—it gets converted into heat energy in your body and the rock’s surface, and also into internal energy, causing you to feel tired.
So, even though no work is done on the rock (since there is no displacement), the energy you use is transformed, mainly into heat and fatigue.