Plus, Ogygia probably has little to no magnetic field because it lacks an atmosphere to begin with, right?
I think that you have cause and effect reversed there - a magnetic field would come from a rotating (read: hot/liquid) electrically conducting (iron is good for this as well as being dense for gravitational purposes) core and the presence of such a field would help retain an atmosphere by preventing solar winds from stripping the atmosphere away. The presence of an atmosphere does not affect the magnetic field in any way. Additionally, magnetic field or not, an atmosphere would require enough gravity to hold it in place - Mercury has almost no atmosphere, but a strong magnetic field.
To add an atmosphere to a planet heavy enough to hold one, you would either want to add an artificial magnetosphere or continually add more atmosphere to account for solar winds - Mars loses about 100 grams/second according to the MAVEN mission.
And for the sake of completeness on the topic, we think that Jupiter and Saturn get their magnetic fields from a thick layer of liquid, metallic hydrogen that wraps the solid core.
Edit: A quick search for "artificial magnetosphere" turned up
an article about a plan to put a generated magnetic field between the sun and Mars in order to place Mars within the wake of the field, largely protected from solar winds. Another orbital structure!