The Magnuson–Moss Warranty Act does not allow warrantors to void warranties on the basis of non branded parts or because an unrelated modification has been done. It does not mean they will not try but it is unlawful.
The ESP is not a warranty, regardless of what people call it. It is a service contract, and Mag-Moss does not address such products. Read the actual ESP contract and you will find they reserve the right to void the contract for nonstandard equipment, trailer hitches, and a lot of other stuff. I've even heard of a situation where an inspector for the ESP company denied coverage because the customer had an aftermarket oil filter installed, as ridiculous as that is.
When it comes to the factory warranty, that does fall under Mag-Moss but that law doesn't say they can't deny warranty coverage for nonstandard parts. It does say they can't deny coverage if you use nonstandard maintenance products, such as lubricants and filters, as long as those products meet the same standards. The only way the manufacturer can demand you use their maintenance products is if they provide those products to you free of charge. Harley can in fact deny warranty coverage for your engine if they detect tampering with the emission system including the tune. Note that the upgrade kits Harley sells these days come with a street legal and emissions compliant tune required, and using anything other than the legal tune will void the warranty. You will also be hard pressed to get them to voluntarily approve a warranty repair if they open up the engine and find an aftermarket oil pump or other nonstandard internal parts, regardless of whether you think the nonstandard parts did or did not cause the failure. You can sue them under that federal law of course, but I wouldn't be surprised if you lost.
If warranty or an ESP are of paramount importance to someone, those folks need to think long and hard about the mods they make and not just assume things or listen to someone trying to sell them products. Do the research, don't go by what Joe Blow says, weigh the options, and if they really want to do the mods be aware there is a certain amount of risk. And unlike the factory warranty, where Harley could deny an engine claim but still be required to cover the other items under the warranty, ESP just voids the entire contract. At best you could request a prorated refund of the purchase price for the ESP.
Jerry