If you want to do this so that the ship itself is moving, and not the world around it, you will need to have make your own gravity or basing solution.
By default the gravity in UE4 isn’t made to change direction, you’re either being pulled up or down on the Z axis. So you could add in directional gravity.
Another solution would be to change some of how walking around and basing works. A good first step for this might be to change how the game checks the slope of what your character is standing on, because that bit of code will un-base you automatically once the slope reaches a certain angle. With this you’d have to either disallow jumping or make a custom jumping solution for when you’re walking around in ships.
Also if it helps, the game “Angels Fall First” (The UDK version) handles walking around on moving ships is by having a separate area on the map for ship interiors which it teleports characters to. The rooms never move or rotate, and the windows that show action outside the ship are just render targets.