Roman emperors where usually not seen as “gods” in their life time. Rather there are 2 links between emperorship and “godhood” that lead to this common misconception. First in that Roman emperors often where raised to the level of gods after their death with (usually) the approval of the senate through the process often called apotheosis. Second, the was an imperial cult, which worshiped the emperor (and his family) as part of the divinely sanctioned authority of the Roman state. Basically they worshipped the office held by the emperor. For example Augustus was only deified after his death, but during his life he was seen as divinely appointed to hold Roman authority as he was the heir of Caesar who was deified by the senate. There’s some obvious simplifications here with this description… but it’s a general outline.
To your main question, with the rise of monotheistic cults (of which Christianity would became the dominant in time) in the late empire. This process didn’t change as much as one might expect. While apotheosis was no longer possible because there is only one god, sanctification was in some ways similar! So you have Roman emperors and family members that would became saints and than be “worshiped” (im Catholic and worship is rly not the best term here, but for simplicity let’s just say that). Most famous examples are probably Constantine and his mother. There are similar parallels in Eastern churches like sanctification of the Romanovs after their assassination in the Russian Revolution.
Also the emperor and Roman rule was often seen as divinely appointed in a similar way as before.. there where major changes in some practices of how this divine rule was worshiped, but the general practice evolved from earlier pagan practices.
So to summarize don’t think of it as a culture change or shift but rather as incremental evolution of divine rulership to match monotheistic (most prominently Christian) practices. Again I simplified a lot and marginalized over some important points, so I recommend doing further research into it.