Some "foaming" is normal, the gears will whip it up pretty good in the transmission.
What you see through the sight glass is the top portion of the fluid, the hydraulic system gets it's fluid from the bottom of the sump and in-trained air will tend to not go that deep.
Quick and easy test, with tractor parked and settled for some time check fluid level, note height and clarity.
Drive it around a couple of min operate the loader and the three point, bring it back to the same point, look at the sight glass, and watch it for about a min, does it clear up or start to clear up?
If it does then you don't have any issues, it's just normal operation.