I feel like you could use something similar to the set-up I’m using for a hovercar that aligns itself to the terrain - I get a vector orthogonal to the ground and then apply torque to reach that rotation. If you want some slight roll, you could calculate a rotated normal vector, then apply torque every tick like so:
FVector torque = FVector::CrossProduct(normal, ShipMesh->GetUpVector() * -1.0f) * TorqueStrength;
ShipMesh->AddTorque(torque);
Then, when the player releases the input, reset your normal vector to one going straight up.
Hope this helps!