From my understanding, English speakers referred to all continental West Germanic speakers as "Dutch" across the middle ages and early modern period. German and Dutch-speaking settlers of the United States were given the same ethnonym across the colonial period and up until the 19th century, which still lingers in the form of Pennsylvania Dutch. Did "German" supplant "Dutch" sometime after the beginning of English colonization but before the emergence of German nationalism? How did this happen?
From my understanding, English speakers referred to all continental West Germanic speakers as "Dutch" across the middle ages and early modern period.
More accurately put; "Dutch" was one of the many terms used for speakers of various Germanic languages on the continent, including those who we would (somewhat anachronistically) call Germans today. Mind you, for much of the medieval period; it didn't refer to a single language. There was no conception, neither in England nor in the Netherlands nor in what is now Germany, of "German and Dutch" forming the same language; just as there was no conception of "the Dutch and the Germans" forming a single polity. Medieval people simply didn't think in nationalities. This was a foreign concept to them.
Medieval and Early Modern English used many different monikers, none of which match fully with what the word "German" means today. Among "Dutch", "Almayn" was used, as were "Saxon" and "Teuton" and still others. Most of these were, like the Germans themselves in this period, ill-defined. For example, "Almayn" was a French-derived term and usually tended to refer to regions of German adjacent to France rather than what is now Northern Germany. "Saxon" usually referred to Northern or Central Germany and "Teuton" was a more formal, learned term for people or institutions associated or affiliated with the Holy Roman Empire.
"Dutch" on the other hand, was initially not a geographical term, but one which referred to language.
It's often said this word derives from the German word "deutsch", but that is not true. The word Dutch in all likelihood derives from a Frankish word (reconstructed as *theudisk) which meant "not-Latin/not-Romance/Germanic" and as such, formed a counterpart to *walhisk (cf. modern Welsh, Walloon) which meant "not Germanic/Celtic/Slavic/Romance". It's though to have originated in northwestern France/western Belgium (ie. within the modern Dutch speaking area) due to the close proximity of Romance and Germanic speakers present here, as well as the typology of the reconstructed form. It was first attested in a Latin text though, where it referred to the non-Latin language of the people of England, i.e. English.
On the continent "Dutch" evolved into various forms, but for a very long period remained a vague term. In what is now Germany, "deutsch" , up until the 18th century, referred to language, not much else. In many ways its meaning was much closer to what we would today refer to as "Germanic" or "common tongue" than "German".
In the Early Modern Period, you can see some specifying taking place; not in Germany, but in the Netherlands. Dutch scholars are starting to call their language "Nederduytsch", both as a calque from "Germania Inferior", as well as referring to the relative flatness of the local topography and referred to more easterly dialects as "Hoogduytsch". Both words were later calqued by German.
In English, the sticking of Dutch to the Netherlands/Dutch Republic/Dutch language is both due to proximity (the Dutch were the closest speakers of Germanic languages) and intensive contact, Dutch being the primary foreign merchants in English ports (and vice versa).
At the same time, Germany was starting to become "less vague", by the emergence of states like Bavaria Prussia, Saxony and Austria. Nevertheless, for most 18th English speakers "Germany" would have been virtually synonymous with what is today called "Central Europe", including the relative amount of vagueness present in the latter term. This is in line with the origins of the word "Germany" in English, being derived from the works of Tacitus who used it to refer to the lands beyond the Rhine, bordered only by semi-mythical "Scythia". Some of the initial use remains visible in English today, it being the only European language which distinguishes between "Germanic" and "German" only by context when translating ancient Roman texts, not by actual word-use as all other European languages do.
With the formation of Germany and emergence of German nationalism (which had meanwhile adapted the adjective "deutsch" into a noun -- Deutsche, Germans -- , which was very uncommon for the Early Modern and Medieval period) the term "Germany" and "Germans" became more precise; becoming essentially what it means today.
The use of "Dutch" in "Pennsylvania Dutch" isn't a relic of older use though; it's an English rendition of the Pennsylvania German autonym "Deitsche". Ultimately, both Dutch and Deitsch have the same origins, but the Americans did not retain the Late Medieval use of "Dutch" in North America.