It can be done, but...
Air dryers are wired so the compressor crankcase heater is on anytime the unit is connected to power, assuming it has one. If it doesn't have one there are kits to add them.
You can get info off the condensing unit data plate to get the specs. Tecumseh condensing units are common and the usually have a band-type heater around the outside of the hermetically sealed compressor.
You can't let the condensate freeze in any piping or drain bowl or it will crack. A timed drain valve will help if you leave it on all the time. If your shed is insulated, heat from the compressor and the dryer might be enough to keep things above freezing.
With that said, winter humidity is so low, you may get by without using your air dryer in the winter, unless you need super clean air for painting.