Firstly, I think if you can't train safely, it's better not to train - this is especially the case in water.
My local pool does not permit the use of fins or weights, and so lots of the exercises I would typically perform in training are not possible, or might lead to poor form once back in kit. Consequently I tend just to swim a lot of restricted-breathing lengths in patterns, e.g., (with numbers denoting the number of strokes between breaths) 2-3-4-5-4-3-2, that is to say, I swim a length breathing every second stroke, then a length breathing every third stroke, and so on. I usually swim breast stroke, just because otherwise I run out of pool too quickly. I would also like to go higher than five breaths, but that's a full length of my pool, and I am mindful of the fact that there is no buddy system in place.
Sometimes I vary my breathing continuously instead, e.g., swim two strokes, breathe, swim three strokes, breathe, swim four strokes, and so on, up and down again. I've found myself more likely to lose count this way, though.
Alternatively I just swim with fewer breaths, e.g., only breathing every fourth stroke (breast stroke) or sixth stroke (crawl - I only breathe every fourth stroke on crawl anyway). Or with crawl I will swim with a pull buoy between my knees, only breathing at the ends of the pool (23m).
When I swim breast stroke for apnea training I put very little into my arms and concentrate on kicking as hard as I can. I do this just because it seems to bring about the benefits of hypercapnic/lactic training more quickly - but that might just be me.
I swim these lengths in sets, and often intersperse these sets with two-length sprints (with full breathing).
Remember to take regular breaks if you are doing this, and to keep in mind that you don't have a buddy system in place. Also, you don't need to keep your lungs full to do these exercises, but I personally wouldn't do them empty either - swimmer's lung is a sort of pulmonary oedema, somewhat similar to a squeeze, and I suspect vigorous empty-lung training might make it more likely (that's a personal suspicion only - not medically determined or anything like that).
Finally, I personally believe that long, slow cardiovascular training over a sustained period of time (often called 'base training') has underappreciated benefits for freediving, so you could just do long continuous swim sessions (say an hour or more) in the pool with no modifications and chances are you'll eventually see decent benefits.
I hope this helps.