Image Source: Boland
Masking helps us to make changes in a part of the image, preserving other part of the same image.
Alpha Channel is useful option to define the image in white, black and gray shades making it easier for us to make selection based on those colors.
As you see in image I2, white part becomes the selection area, black becomes the unwanted area to get rid of, whereas the gray portion acts as the part of image which will be partly transparent based upon the shade of gray applied to it.
Having known that, now you can easily take selection of the other parts of the image with path and then go to the channel palette for the selection of hair and transparent parts. Duplicate the channel mode which gives distinct separation of required and unwanted area. In order to get better result, we can adjust the white, black and gray shades of the alpha channel layer using Image> Adjustment> Level. Now from this alpha channel layer, take the selection and add vector mask on the image layer. You will get the final output as in Image I3 shown above.