Well, my friend I’m a huge proponent of both of those movement patterns (seeing as I like to powerlift and am a powerlifter and all) but my best guess would be to perform other movements that activate the same muscle groups as your squats and deadlifts would. To replace the squat, you always have leg press, extension, lunges etc. and to replace the deadlift you have hamstring curls, bridges, dumbbell deadlift, Kettlebell swing, rows etc.
Some of those movements aren’t for legs but they do cover some of the muscles that you’ll be missing without either the squat or the deadlift.