Is this legal?
Yes, it’s called “opposition research” (frequently abbreviated “oppo”) and the political parties do it constantly to one another. Because they’re doing it this much, and because they have a LOT less scruples than you do, they’ve probably already uncovered everything you would. But maybe not all.
In addition, doing this publicly would put the target on alert, so they’d specifically run interference against whoever you hired. This wouldn’t make their job impossible, but definitely harder.
And, finally, whatever new dirt you do manage to gather might not matter. The things Trump has done that the public already knows about should be enough to put him in prison for life, and yet he’s still in the current US presidential election instead of incarceration.
This guy’s company is planning to build nuclear-powered datacenters btw. Check in with yourself on whether you think that’s a good power this responsible human being should have.