Geese are, at least among the domesticated farm birds, relatively smart and have a well defined social structure in the flock. They can be taught that the farmer is the "alpha" bird and going after humans invites your wrath. Its time consuming at first and yoy look like an idiot doing it but once you have an established flock it requires little reinforcement and the new ones learn from the old that you are in charge.*
*A mated pair walking their newly hatched goslings will always have the gander question your authority and the goose will summarily attack, even accidentally killing her hatchlings, if he fails to drive you off.