When working with images that contain transparency, you can quickly select all the areas that are opaque by using the Load Selection tool. In other words, Load Selection creates a selection that goes along the edges of a layer — if a layer is rectangular, a rectangular selection will be created, if it's a circle — it will create a circular selection.
Similarly, when used on a layer mask, Load Selection will automatically select only the areas that are visible, leaving the masked areas outside of the selection.
Do any of the following: