When the franks, goths and vandals invaded the people the conquered still considered them selves romans when did they starts to form their own identity?
It could take, depending of the regions, merely one generation or several centuries to observe Romans adopting a Barbarian identity : for example while northern Gallic elites seems to have largely (if not systematically) endorsed a Frankish identity as early as the Vth century, people in Central and Southern Gaul still considered themselves Romans by the VIIIth century.
Reasons for were probably diverse, but an important factor seems to have been the social opportunities and motivations holding or switching identities (keeping in mind we're informed essentially about elites and not the general population which is assumed more than evidenced following the trends). You might find some elements of answer in this earlier post focusing on Frankish identity ( u/Libertat) but I'll summarize it a bit and dwell a bit more on Spain and Africa.
When Barbarian kings took over more or less important territories of the Roman Empire, they were already importantly romanized out of centuries of contact, interactions and integration within imperial frameworks : a Barbarian identity was less defined by ethnicity or language (especially as Romans tended to join up with Barbarian groups) than their political/legal relation with the emperor, the empire and their own rulers as an armed community. You were a Frank, not because you spoke "Frankish" or could trace your ancestry from Germanic origin, but because you obeyed a Frankish king and weren't a Roman citizen. As long Roman structures remained in place, a legal distinction could be drawn (altough Roman themselves tended not to consider citizens of Barbarian origins, as Stilicho, as 'real' Romans) in the same time a social distinction was made with Roman elites defined by their public service and employment in the Roman state (locally, in the municipes, regionally or in service of imperial network or bureaucracy) whereas Barbarians were more readily associated to military services and communities in addition of their specific legal frameworks (altough largely Roman).
When the Western Roman Empire went the way of the dodo, however, holding onto a Roman identity in the western provinces required some re-evaluation. In regions that least suffered from the damages and crises of the Vth century (essentially Spain, southern Gaul and critically Italy) and where state structures survived (even if, outside Italy, more or less importantly transformed) which allowed Roman elites to perpetuate their social codes more easily in spite of a relative reduction of social opportunities : we're talking public service, some classical appartus as education, games, etc. The empire and the emperor still existed at Constantinople and, for some generations was held the fiction that Barbarian kings did not conquered western provinces as their own land but were apointees of the imperial court to rule these regions in the same time they ruled over their own people. A public servant in southern Gaul or Spain thus still worked for the Roman state that somehow happened to be overseen regionally by a Barbarian king (that could be more or less virtuous, more or less Roman-like) and while it created new legal and fiscal realities, there was no need for them to consider themselves other than Roman.
In more damaged regions, altough the same fiction was held, this were really different : the Roman state had but collapsed in Northern Gaul would it be in military, civilian or even ecclesiastical matters. Roman aristocracy did not disappeared, but its power and raison d'ĂȘtre became more local, important families dominating their immediate region thanks to sheer social, economical, religious or even military influence as the region fell prey to unmitigated warlordism. As Franks, under Childeric and Clovis, managed to firmly establish their hegemony, the political precarity of local elites might well have motivated Romans to adopt Frankish social codes to guaranteeing their position as access to the royal court and service couldn't really pass trough the skeletal public service that somehow still existed in the late Vth/early VIth century. These codes were themselves often Roman or romanized but identified as Barbarian and a whole part of what was being a Barbarian in Romania since a century : militarized apparatus (complete with the king as ring-giver, that is having his trusted servants displaying a ring on their sword), 'ethnic' jewelry and clothing (the former being imported from Constantinople), adopting Frankish names (altough possibly keeping Roman names and likely use of Latin), etc.
It was not necessary to prosper or maintain one's position (especially as ecclesiastical service could provide with civilian authority), but it did help in a period of fierce rivalty for access to centers of power now that imperial service was out of reach : by the VIth century, in northern Gaul, it's not really possible (or even relevant) to make a difference between Franks and Romans having adopted a Frankish identity, especially as intermarriage seem to have been fairly easy (while technically illegal for other Barbarian groups in former Romania). and as Franks adopted the Nicean credo Romans followed.
There is even less historical sources on other margins of the former western Roman Empire, for instance in Raetia or Noricum, but the apparent damages might have well led to similar consequences.
This shift of identities took significantly longer in the rest of the western provinces however, as there was less of a need for and more social obstacles to. It's not that Romans didn't adopt Barbarian social codes and even in Africa (where relations with the Vandal or Mauri kings could be fairly tense) this can be observed as much as Romans adopting a Barbarian identity early on. Political and fiscal advantages were clear and opportunities certainly sized. Nevertheless, it wasn't that common neither sudden. Critically, it didn't didn't put in question the existence of defined Barbarian and Roman identities, at least theoritically distinguished by their function, their social role or their religion.
Eventually, however, the aformentioned fiction began to fade away : whereas the Empire was effectively too remote or even appearing as politically (in Italy or Spain, notably) or religiously threatening (gaining the reputation as a cradle of heresy), it became obvious Barbarian authority was there to last and both could and should be accepted as such as overall, the collaboration between Barbarian and provincial worked out (arguably the Imperial reconquest of Africa cut short any possibility for Vandals or Maurs to do so in the region).
A sense of political, social and religious commonity emerged as the functional differences between communities grew more irrelevant : one could be a Roman and still lead a Barbarian army under the king, a Barbarian could be a public servant, kings themselves adopted the same credo than Romans and thus presided over religious synods, etc. Provinces were not just led by kings but formed valid kingdoms of their own various communities could exist, Barbarian or Roman under a same king, with both of them acknowling the latter as their own. There was still a distinction made between being a Roman or a Barbarian, but not only they began by the VIth century to be 'ethnicized' (a Roman being assumed having the virtues of famous Romans, whereas Barbarians the virtues and fallings of Latin litterature) but other forms of identities were stressed notably local origin and alliances, familial lineage and being Christians (whereas the outsider was the heretic, the heathen or the Jew).
The world of these people was no longer 'Roman' in the sense everyone could have access to what was associated with Roman culture (safe maybe some inherent virtues) but 'Barbarian' in the sense it became a collective political identity even when a family or an individual could identify as Roman.
The process took more or less time, essentially depending from political contingencies and the whole array of opportunities, personal and nobiliar affiliations, but by the late VIth century in northern Gaul and in the late VIIth century, as Roman and Barbarian social codes were effectively mixed up and the same the latter became predominant as a political and "ethnic" identity regardless of ascendency.
Even in southern Gaul, where a Roman identity held out until Carolingian conquest, actual social differences with the Merovingian realm aren't that obvious. Although Aquitaine tended to be a fairly distinct part of the regnum, as the lot of peripheral principalties, the assertion of Romanity was more a product of their growing autonomy during the period of regional fragmentation that marked the Late Merovingian period and not a sustained effort to hold on an identity threatened by Franks where both the former and the latter eventually saw themselves as "foreign" whereas they shared a same cultural background.