It's set as an environment variable called `DATABRICKS_RUNTIME_VERSION`
In your init scripts, you just need to add a line to display or save the info (see python example below):
import os
print("DATABRICKS_RUNTIME_VERSION:",os.environ.get('DATABRICKS_RUNTIME_VERSION',None))