First define sway. From the speed you say, it could be actual trailer sway, or are you a newb to towing and it’s just a little wiggles?
Second, assuming you have a 1000lbs or so hitch weight (loaded), do you have enough rear tire to keep the truck from exaggerating the symptoms due to squishy tires.
Third, most real trailer sway (which you haven’t defined, it gets worse the faster you go and you won’t be able to drive any faster without losing control) is due to not enough tongue weight and/or too much weight/length aft of the axles. Does it look like you’re dropping 1000lbs on the hitch? It should squat that truck pretty hard before the wdh. Does it?
Have you tried without the wdh to prove or debunk your theory of the ESc working against the wdh?
Have you taken too much weight off the rear axle with the wdh? Or is it hitch light already like I mentioned above?
Are the trailer tires properly rated and inflated? Is the suspension worn out?
Need more info to even begin to diagnose. Or find a buddy who knows what they’re doing to check it out with you.