Questions about the practical implications of philosophy are dense and complex, not easily handled here. I take the heart of the question to be about the more specific subject of Locke and Hume and the 'explicit connection' between their empiricist philosophies, their racialist views and entanglement with colonialism and imperialism. I include slavery in the picture.
Racial elements in the writings of Locke and Hume
It has long been known that there are what we recognise as racialist elements in the writings of both philosophers. Here's Hume:
I am apt to suspect the negroes, and in general all other species of men (for
there are four or five different kinds) to be naturally inferior to the whites.
There never was a civilized nation of any other complexion than white,
nor even any individual eminent either in action or speculation. No
ingenious manufactures amongst them, no arts, no sciences. ... In
JAMAICA indeed they talk of one negroe as a man of parts and learning;
but 'tis likeley he is admired for very slender accomplishments, like a
parrot, who speaks a few words plainly. ('Of national characters' in Essays: moral, political and literary.)
As for Locke :
There are two passages in the Essay which
strongly suggest that Locke's view of essence has structural connections with
racist ideology. With respect to the species "man" Locke points out: "He that
annexes the name Man, to a complex Idea, made up of Sense and spontaneous
Motion, joined to a Body of such a shape, has thereby one Essence of the Species
Man; and he that. . . adds rationality has another Essence of the Species he calls
Man: by which means the same individual will be a true Man to the one which is
not so to the other." Given this account, it is possible for a person to deny that a
Negro is a man. Locke has been accused of suggesting as much by Poliakov who
quotes the following passage in support of reading Locke as a racist: A child, says
Locke, "having fram'd the Idea of Man, it is probable, that his Idea is just like
that Picture, which the Painter makes of the visible Appearances joyn'd together;
and such a Complication of Ideas which he calls Man, whereof White or Flesh
colour in England being one, the Child can demonstrate to you, that a Negro is
not a Man, because White-colour was one of the constant simple Ideas of the
complex Idea he calls Man: And therefore he can demonstrate by the Principle, It
is impossible for for the same Thing to be, and not to be . . . that a Negro is not a Man." (Kay Squadrito, 'Racism and Empiricism', Behaviorism, Vol. 7, No. 1 (Spring, 1979), pp. 105-115: 113.)
Quotations from Locke, Essay concerning Human Understanding, 1690, III.6.26 & IV.7.16.
Logical role of racial elements
The racialist texts are there; no denying them. But the question of their logical significance is another matter. I cannot see that Locke's or Hume's empiricism entails racism. One can without contradiction affirm the empiricism and repudiate the racism. Nor, from another angle, does their racism presuppose their empiricism. Locke and Hume could have held the racial views they did whatever their epistemology and metaphysics. In regard to entailment or presupposition I can't see an 'explicit connection' between their racialist views and their empiricism.
So the racism of Locke and Hume is not integral in any way I can see to their philosophical theories; it is a contingent and accidental detail, as witness the many philosophers who have since espoused their views without any tincture of racism.
Practical significance of racial elements
Time now to introduce an engagement of Locke in political practice not mentioned so far : his hand in drafting the constitution of South Carolina in 1682. Locke was more involved than Hume in the direct application of political theory to practice. Nothing in Hume's life matches Locke's involvement in constitution-making.
In ST, §86 Locke refers to the (male) head of a family as master of wife, children, servants, and slaves. He has the power of life and death only over his slaves. There is no critique of the institution of slavery.
This attitude towards the power of life and death over slaves is explicitly present in the South Carolina constitution:
The paterfamilias's [male head of family's] "Legislative Power of Life and Death" was the same power and authority possessed by "every Freeman of Carolina over his Negro slaves of what opinion or Religion soever" (Fundamental Constitutions
§110). That article was missing from what seems to be the very earliest manuscript of the Fundamental Constitutions, but its first appearance was idiomatically Lockean in its insistence on the slaveholder's "absolute arbitrary Power, over the Lives, Liberties and Persons of his Slaves, and their Posterities." It also went untouched in the 1682 revisions even as Locke renumbered it with all the rest. There is therefore no mistaking either his tacit commitment to this brutal provision or to the hold the master-slave relationship had over his political imagination both before and during the composition and revision of the Two Treatises. (David Armitage, 'John Locke, Carolina, and the "Two Treatises of Government"', Political Theory, Vol. 32, No. 5 (Oct., 2004), pp. 602-627: 619.)
Here then is a clear case of Locke's involvement with colonialism and racism. The Carolinian slaves were black.
Locke and Hume were great philosophers; they were also men of their time. Their racial prejudices were common coin which they neither originated nor circulated to any great effect. I have never heard of anyone's becoming a racist as a result of reading Locke or Hume. Their racial prejudices were ignorant discrimination, note them though we should. Those prejudices connect systematically with nothing - certainly not the elaborate and pseudo-scientific racial theories that scarred the 19th and 20th centuries from Count Gobineau through the Protocols of the Elders of Zion to Alfred Rosenberg and Dr Henrik Hendrik Verwoerd.