I think the quick answer to this question is that there was no straightforward transition from heavy infantry to heavy cavalry. The elite heavy cavalry (cataphracts et al) that the Eastern Roman Empire was famed for were introduced into the Roman Empire as early as the first century AD by Trajan and they are even mentioned in the Battle of Actium in 31 BC. And so while cavalry in general became increasingly important over the course of the subsequent centuries, it should also be noted that heavy infantry was still a part of the Eastern Roman/Byzantine war-machine. It is probably fairer to say that their relative importance shifted as warfare changed.
This shift in emphasis was not really a specific change from Imperial Rome to the Byzantine Empire as much as it was a general trend across Europe at this time. Most European armies were infantry-based up until the Middle Ages when cavalry became increasingly dominant. You can observe this general trend through the arrival of groups like the Huns and Avars (and later the Magyars and Mongols), who were largely mounted. They often came from the central Asian steppes which are flat and well-suited to raising horses and they formed a big part of the culture. I think it is probably fair to say that this kind of geography made as much of an impact as any developments in military tactics. If you go back to Classical Greece, you will notice that most warfare was infantry based except for Thessaly, where cavalry was more common. This is because Thessaly is flatter so not only is it easier to raise horses on plains, but it is easier to fight with them as well. The rest of Greece was too mountainous for either concern to be practical.
As well as geography there were other concerns. One would be the ability to breed strong enough horses. A heavy cavalry man in full armour (sometimes including horse armour as well) would have weighed a lot and so you would need some way of breeding horses strong enough for the task. There just was not the infrastructure in the rest of Europe at the time to do this. However, you do notice that after the arrival of effective horsemen, their usage starts to increase in Europe. In the early Middle Ages, you can look at Anglo-Saxon England for example and the Battle of Hastings. The elite of Anglo-Saxon society had horses but typically dismounted before fighting. The Normans however fought on horseback. Although the resulting victory was not down to the fact that some Normans were mounted and the Saxons were not, it does demonstrate a change as mounted warfare becomes more effective. One reason for this is probably the adoption of technology such as the stirrup from the eighth century, which made horse-riding more effective.
If we look at Rome specifically, then we see that even though they are famed in the popular consciousness for its infantry legions, their military machine was not static and they adopted and increasingly utilised heavy cavalry during the imperial period. Heavy cavalry seems to have been introduced from the east, where armoured horsemen had existed for some time. Units of cataphracts were incorporated into the army by Trajan (98-117) and Constantius II (337-361) strengthened their numbers and usage. The Notitia Dignitatum, a kind of military list of units presumed to be from around the 400s, also notes several regiments of heavy cavalry. As the Eastern Roman Empire transitions into what we tend to term the Byzantine Empire today, we can see that the use of heavy cavalry had already been well established. They were generally effective troops the Emperor even maintained an elite force of heavy cavalry called the skholai.
However, in addition to heavy cavalry, the Byzantines also continued to utilise heavy infantry. Their look had changed from the popular image of legionaries wearing lorica segmentata is not really accurate as this style of armour was probably only used for the first three centuries of the current era. The use of heavy infantry is widely attested in Byzantine sources and several of the imperial guard regiments were composed of heavy infantry but it is probably fair to say that their dominance declines because they stopped being effective against eastern opponents. As early as 53 BC, during the Roman Republic, the Battle of Carrhae demonstrated a significant weakness of heavy infantry as the Roman force under Crassus suffered a crushing defeat, having been outmanoeuvred by Parthian horse archers and cataphracts. Heavy infantry is effective when appropriately supported and after the Islamic conquests of Byzantine territory there is a slow shift away from pitched battle towards regular skirmishes between more lightly armed and armoured troops.
If you want to follow up on sources specially on the military angle there are quite a few Osprey books covering topics related to this. I counted recently and they have about 13 titles on Byzantine forces alone. The quality can vary massively, some are excellent, others are best avoided, but the recent Roman Heavy Cavalry (1): Cataphractarii & Clibanarii, 1st Century BC-5th Century AD (2016) covers a lot of this material and a follow-up is due this autumn which will focus on the Byzantine period. Byzantine Imperial Guardsmen 925-1025 (2012) has a lot on the elite fighting forces, and there is also Romano-Byzantine Armies 4th-9th Centuries (1992) though I did not rate it. Beyond that there are numerous specialist titles. Military history can be a bit of an odd discipline but there is certainly no shortage of secondary literature on the topic.