The answer is based on my talks with people of Polish origins in East Prussia and Upper Silesia and might not represent all the cases. I also do understand the answer does not cite any sources.
Since about late 1944 it was clear that the territories west of Poznań and Łódź are going to be in Poland. The Allied forces which were present in Western (of 1939) Poland were:
During the liberation of Poland all AK forces were eliminated, both physically, or just wiped off to forests, etc. Of course at first the administration were conducted by military (Soviet and People's Poland), then civilians. The civil administration were backed by at first NKVD, but later replaced with Militia forces, and KBW, having Polish personnel.
The tasks of these de-facto military organizations were to suppress any "reactive movements" ie. all activity leading to re-establishment of pre-war capitalist system. They performed the same tasks in the Recovered Territories.
It became clear (in late 1944) that the Soviet Army is too strong to be stopped by Germans, which was met with mixed feelings in Poland, but mainly people were happy the war would end at last. There was a faith that Western Powers will help to keep democracy.
The Polish in Third Reich were clearly happy seeing liberating forces approaching, as they did not know everything about repressions of a new regime (repressions were mostly hidden in Poland itself). The German administration was ruined and many people tried to escape or save their possessions.
The Polish were not afraid of Russians, and of course both Polish armies. So when Allies entered, the Polish stopped hiding and began to co-operate and help. Soon it became clear who was Polish and who was not. The Polish administration knew these people. They were not high-class persons, and rarely middle-class (eg. teachers, doctors, engineers etc.); mainly they were peasants and workers, and as such not enemies of Soviet/Polish administration. Many of them have risen to became mayors or other officials. And they also knew one another; they knew personally who was German and who was Polish. If they didn't, they could easily recognize Germans by their fashion, behaviour (Germans were afraid of some kind of revenge and now they were trying to hide), way of speaking, what they had at home (like photographs of male relatives in Wehrmacht uniforms). If there were Germans disguised as Polish, they were easily recognizable. It is difficult for Germans to speak Polish without a strange accent (it was easily recognizable even for a Russian officer). It is difficult to pronounce clearly things which every Pole could (like a prayer, Mickiewicz rhymes, etc.). Please also note that German administration was known for their meticulous record-keeping. Anyone who wanted to prove their ownership of a building, shop, or land, needed to keep their own identity and thus couldn't just pretend to be Polish.
The names were also a clue, but not always decisive. There were Polish-German intermarriages. A few years ago I met professor Ulrich Schrade. He was from East Prussia and was born in Polish family. Both first and last names are German (the first name should be "Ulryk" in Polish, but it is very rare name). I did ask him if he was German (he spoke Polish fluently) and he said that he always was Polish, but it was common to give children German names even among Poles. So names did not matter in many cases (also some Polish could be traitors).
So answering shortly: the Germans wanted to be known to be Germans because they believed they would be allowed to keep their property. The ones who wanted to hide were easily unveiled the same way as we do recognize foreigners.
Eventually they lost everything, but it was too late to hide, and in fact they had no reason to stay other than sentiment for their local homeland (Heimat).