Shen Lian was using the power of his Primordial Spirit to stabilize Zhao Xiaoyu's injury and thus he knew of the changes that happened to her.
Obviously, Wang Shidao spoke about the Enlightenment Scripture specifically for Zhao Xiaoyu. It explained thoroughly about Primordial Spirit, Celestialism, and the path of Shen to reach to the source of Zhao Xiaoyu's injuries.
He did it indirectly through his preaching. Shen Lian and Zhao Xiaoyu were aware of what was happening but decided to just keep quiet about it.