The "in_memory" location is usually in your temp directory in a temporary file geodatabase. You can test this by running any tool and saving it to an "in_memory" location and then using the data sources tab in ArcMap. This data is indeed deleted after your script is complete or you close ArcMap. I am not sure where layers from MakeFeatureLayer() are stored. But below will show an example of where an in_memory feature class is stored.
I should Add you can find this location by using arcpy.Describe()
I should mention this doesn't seem to work when referencing the "test" feature class by the test variable. I get an error that says "in_memory\test" does not exist.
Doing this for a feature layer will return the data source that the layer is created from. Feature Layers are a different animal than a feature class as it is just referencing a Feature Class.