A farmer from Northern Ireland has died following an incident on a farm on the border between Londonderry and Donegal.