Moisture in an oil is one thing that can cause foaming. What temperature does the gearbox run at once at full running load. The moisture could be present at startup and evaporate off once the oil reaches operating temperature and stays there over a period of time.
Also at startup and low speeds there could be a certain amount of air being entrained in the oil which is dispersed and works it way out of the oil over time once at normal operating conditions.
Particle contamination can also be a probable cause of foaming. Is it possible that the particles are present at startup and are slowly filtered out during operation? Is there a filter present?
Just an endnote. Be very careful of adding an anti foaming additive to your oil as overdosing of this additive in an oil can cause foaming rather than prevent it. It has to be added in very specific amounts.