@user287001's answer is probably the simplest way to do what you want. The problem with it is that both the offset and the opacity are baked into the mask. I want to show that there is a 100% dynamic solution.
(I'm using Photoshop 2022, but I think this method should be possible in Photoshop CS6 as well.)
Method

Convert the layer to a Smart Object.
Make two duplicates of the layer.
Wrap the topmost layer in a group.
Wrap that group and the layer below in another group.
Add a Stroke effect to the topmost layer. Make sure to set Position to Center and set the Size to twice the offset you want.
Enter the topmost layer's Blending Options. Set Fill Opacity to 0% and press OK.
Enter the inner group's Blending Options. Set Fill Opacity to 0% and Knockout to Shallow.
Now you can change the opacity of the edge by changing the opacity of the bottommost layer and you can change the offset by changing the stroke width of the topmost layer.
If you enter one of the Smart Objects (which all point to the same image) and change the transparency of the original image, the edge will update accordingly.

The downside of this method is that it looks a bit messy in the Layers panel and can be hard to understand for other people opening your document.
Explanation
Let me try to explain what's going on. It's a bit convoluted.
The topmost layer is used to create a stroke that follows the opacity of the original image, but without the image itself. That's why we set the Fill Opacity to 0%.
Then we need to subtract that stroke from the original image. For that we can use knockout. But it won't work directly on layer effects, so we need to apply the knockout to a group around the layer with a stroke.
Turning on Knockout will knock a hole in whatever lies below. The hole isn't visible unless you set Fill Opacity to 0%. The Shallow setting will confine the knockout to the group the layer or group is in. That's why we wrap the group with knockout with a duplicate of the layer in another group. To stop the knockout there, so we don't remove the edge from the bottommost layer.
The bottommost layer is of course needed to render the edge itself.