How to identify an inner class

Yes and no. You cannot get the name of the class as a string from the object, but you can from the script: "is_class" function for Objects of a custom class - #12 by zigg3c

Any class in Godot automatically inherits RefCounted if extends is omitted. Inner classes are no exception, but you can write class testing extends Object and thus have it not inherit RefCounted.

You can also create a new object instance directly from the script:

var t := Test.new()
var s := t.get_script() as Script
print(s.new() is Test)