To do an infinite landscape you need an alternative to the default Unreal Engine landscape.
There’s several options to do that, the voxel plugin for instance (there’s a free version).
I also shared a project i’m currently working on, available in this thread:
Allowing to generate infinite oceans and landscapes from the shader editor.
Here i did the sin(X) you just suggested: