How did a nation like Bohemia, modern day Czech Republic, that was part of larger Germanic empire (in the Holy Roman Empire) manage to maintain a separate cultural identity?
The Holy Roman Empire was nothing more than a collection of sovereign lands that were "united" under an Emperor. Yes, the Emperor did have some say in politics, but the Empire never tried to force all the lands to have one culture--indeed, not even Roman Catholicism was a shared trait among all after the Reformation. So not only did the Empire have no control over Bohemian language and culture, but the German states as well, such as Bavaria, Austria, and so forth.
Additionally, the Czech lands were able to separate themselves even more from the other lands of the Holy Roman (and later Austro-Hungarian) Empire because they were of Slavic ethnic and linguistic background, which gave them a distinct cultural identity. In terms of politics and religion, Jan Hus and Hussite Rebellion in the first half of the 15th century and the Bohemian revolt that started the Thirty Years' War in 1618 were instances to which modern-day Czech politicians could have some type of "national identity" (this was not until the 19th and 20th centuries, though).
With that being said, there was a large German influence in Bohemia until the 20th century. Because of German-speaking administrations in both the Holy Roman and Austro-Hungarian Empires, there was an especially large German population in Prague, including a German-speaking university. And Hitler's reason for invading the Sudentenland in 1938 was to "protect" the majority German population of the area. Why we don't see a large German-influence nowadays, though, is because of the massive population upheavals that followed the Second World War, which included many ethnic Germans being expelled from their homes in the new Czechoslovakia and being forced to move to Germany.
A great introductory text to the Bohemia and Moravia is A History of the Czech Lands, edited by Jaroslav Panek, which is a collection of essays that cover Czech history from the first large Slav migration of the 8th century to the present.
Just a side-point, but many would argue that cities such as Prague were in fact Germanised, in the sense that the dwellers were German-speaking to a significant degree, as well as having the culturally German "Bürgertum" or urban bourgeoisie, as was the case with almost all towns and cities in Central Europe until the late 19th century. Franz Kafka, of course, Prague's most famous son, spoke and wrote in German, for example. It was only after the advent of nationalism in Europe that the demographic makeup of cities began to mirror the rural territories surrounding them.
Ctrl + F Great Moravian Empire - No hits
Don't forget Saints Cyril and Methodius, the missionaries sent to convert the Great Moravian Empire in Bohemia and what was formally the Roman province of Pannonia (Slovakia and south of there). While the Frankish and Ottonian dynasties busily consolidated power in the Southern German region, the Slavic regions were a tad out of their reach. The vaticanConstantinople sent these missionaries in to convert the Great Moravian Empire as per the request of the Moravian knez. In their quest, it is believed that Cyril and Methodius created the Cyrillic language script, thus giving the region a distinct cultural and linguistic identity. There were a number of heated arguments about this as the Frankish bishop in Passau constantly raised a stink about his jurisdiction over the region. Of course, parts of Bohemia became Germanized over centuries as there wasn't a real cultural challenger as you had in what is now Slovakia. Down there is were the Maygars exercised their power. That's a whole different story though.
Source: What I can remember from Stanislav Kirschbaum's "A History of Slovakia" as well as spending a lot of time in that area.
Ctr+F Reichskreise and Imperial Circle - No hits
Certainly another facet that has not yet been mentioned is the fact that the Empire was divided into various Imperial Circles during the Middle Ages. Each of these circles found itself in what we now consider the German speaking world (excluding Switzerland). Each of these Circles had Diets who in turn meet with the Imperial Diets. As Europe and the Empire entered the Early Modern Era, Bohemia was more closely integrated into the Empire, but the period in which lines determining linguistic barriers had been drawn.
Source: Lectures at the University of Vienna, Karl Vocelka's "Geschichte Österreichs"
Forgive me if I made any mistakes, but I think I added to the discussion.
So I sort of wrote my dissertation on this, specifically about the period between 973-1086. I'm not going to repeat what others have said, but it's worth noting that by far the most long-lasting marks of Germanization in Bohemia (and the whole Czech Republic for that matter) exist today in its religion and its language. Although initially Christianized in the 9th century by Byzantine missionaries (Kyril and Methodius, namely) the link with Greece was almost immediately challenged. Missionaries from Austria (a German March) saw Greek Christianity as a threat since it did not comply with the views of the Latin Church. Additionally, Byzantine missionaries taught their converts in their own languages, with a script that Kyril and Methodius themselves created - Old Church Slavonic, the mother of modern Cyrillic languages. This clashed with the Latin Church's view that only Latin should be used, and so they forced the Latin script on the Czechs along with their Latin Christianity. Ultimately, the Latin influences won out, ostensibly because of their regional proximity, but also because of the enterprising ruling Czech family known as the Přemyslids. Although Bohemia had been nominally linked with the west since Charlemagne forced them into paying taxes to his empire, it only really solidified this link in 973 with the foundation of the Bishopric of Prague. This marked the end of Byzantine and Cyrillic influence, although there was one duke in the middle of the 11th century who unsuccessfully tried to bring it back.
tl;dr: Germans are the reason that Czech Republic is Catholic (and indirectly Protestant) and uses the Latin script, rather than Greek Orthodox with the Cyrillic script
(PS: This is an enormously complex era of history, and I've made a lot of enormous oversimplifications - most of which I'm hopefully aware of)
Primary Sources:
Chronicle of the Czechs - Albert of Prague
The Chronicon - Thietmar of Merseburg
Chronicle of the Slavs - Holmold of Bosau
Well the modern day Czechia is composed of Moravia and parts of Silesia in addition to Bohemia.