A couple of ways:
1) Using the ScriptingListener plugin to record the Ctrl/Cmd click on the layer icon or the load selection menu command from transparency channel for the layer.
2) Get layer bounds coordinates for the layer and use to create a rectangular selection.
P.S. How will you reference the layer? Making it active/selected? By name? By index etc?
EDIT: Presuming that the target layer is active you can use the following function call and function to load the layer transparency as a selection:
layerTransToSel();
function layerTransToSel() {
var s2t = function (s) {
return app.stringIDToTypeID(s);
};
var descriptor = new ActionDescriptor();
var reference = new ActionReference();
var reference2 = new ActionReference();
reference.putProperty( s2t( "channel" ), s2t( "selection" ));
descriptor.putReference( s2t( "null" ), reference );
reference2.putEnumerated( s2t( "channel" ), s2t( "channel" ), s2t( "transparencyEnum" ));
descriptor.putReference( s2t( "to" ), reference2 );
executeAction( s2t( "set" ), descriptor, DialogModes.NO );
}