Not the easiest thing to do with shaders. You will need additional information in the alpha channel to be able to perform the outline - one tip is to use 2 thresholds in the alpha, say 0.5 for the outline and 1 for full transparent. When drawing the normal sprite without the outline, it simply uses 0.5 as full transparent.