-
model._getSPRegion().getSelf().getAlgorithmInstance()
gets you the SP -
model._getTPRegion().getSelf().getAlgorithmInstance()
gets you the TM (bad naming I know)
There’s a partial example of this hidden in the serialization docs. It’s not an official API, obviously.