I didn't quite get that. Do you mean how to set POS HOLD mode even though no GPS data is available?
Flight modes are controlled by autopilot. If you don't have GPS lock and have some other sensor, say px4flow then autopilot can be switched to POS HOLD mode without any additional setup (In PX4 firmware, unfortunately I'm not aware of steps in APM). All you need to do is to change your RC stick to POSHOLD mode.
In other words if position fix is available to autopilot through any means (GPS, mocap, optical flow, lidar, etc.) then you can switch it to POS HOLD mode.
Techincally you can not. Theoretically you should be able to stabilize the drone's position with respect to that of target. But in this case when the position lock is not available the drone wouldn't go to POS HOLD mode anyway where you can control it's position. Bit of a chicken egg problem here.
I have not used LIDAR yet for positioning. Neither am I aware of any modules which can be used as position sensor with px4 or APM. Will be happy to hear about if you find anything on this topic.