Alternative way is not ideal but simple and safe. If you are familiar with SBM templates, you may notice they contain many dollar-tags, like $INCLUDE(), $IF(), $SHELL() etc. They are processed by server and replaced with appropriate content (with respect to context, connected user, privileges).
Let's consider a case when you need transition id and name in your script placed on transition form. In this case you should modify formbody.htm template. Find first <script> tag inside <body>, and add new variable declaration right here:
var transitionName_forCustomScript = "$TRANSITIONNAME()"; //I would suggest to don't use common names like transitionName to avoid any conflicts
Now transitionName_forCustomScript variable is accessible from your script on load.
There is a list with tags could be used:
$SOLUTIONID() - id of current solution
$TABLEID() - id of current table
$TABLENAME() - table tame
$PROJECTID() - project name
$TRANSITIONID() - id of transition executing right now
$TRANSITIONNAME() - transition name
$TRANSITIONINTERNALNAME() - transition internal name
$USERID() - id of user which runs transition
$USERLOGINID() - user loginid
$USERLOCALE() - user locale
$USERAVATAR() - path to user avatar