He communicated to Abram (Abraham), and Abraham believed God and God justified him by faith (Genesis 15:5-6), then he later ratified his faith by works of faith and obedience (James 2:21-24). Again, this was before there were Israelites. Curiously, what God said to him in Gen. 15, and what Abraham believed, was not a clear gospel story; God justified him for his trusting in God.
God warned King Abimelech in a dream about taking Sarah, Abram's wife. The king knew God's voice and responded appropriately (Genesis 20:1-11). There seemed to be a greater consciousness of God in those old days than we possess now in our secularized societies. I'm not saying that Abimelech was "saved," but he did believe God's words.
I've read a bulletin by missionaries who have heard of Muslims seeinghaving a dream in which they see a man with wounds in his hands and feet, and telling them to go to the Christians and ask them about him. So God is still speaking to men today, using men and women to reach out to them.
So how were people saved before the OT was written? By God communicating Himself personally and people believing Him. When they believe His words, they are believing the one who spoke them, just like when we believed the message of the gospel weAbraham believed the God who gave it through the preacherGod's promise.
However, theirs in pre-Christ times was not the salvation of the Christian faith, for they were not made children of God (unsure of this), nor did God dwell in them. Not until Jesus died on the cross and rose again could they receive the full salvation of their faith. Their sins were only covered, waiting for Christ to come. We get that doctrine from Romans 3:25-26, which tells us that God overlooked the sins of the past to demonstrate at the present time His righteousness by saving people through faith in Jesus. Many Christians believe that Whenwhen Jesus died, He went into the region where the earlier believers were and communicated the gospel story to them to encourage them so they would have a fuller comprehension of the one they believed in. (This doctrine has its roots in Ephesians 4:9 and 1 Peter 3:19).