On the non-linear energy transfer in a gravity-wave spectrum Part 1. General theory