This is all possible and you will see this type of feature in my Sensor Light Add On . It is called “Snapshot”.
Like @spartan suggested, what you can do is create a small automation that will create a snapshot of your light settings. What I would do is every time your motion sensor goes OFF and your light are ON you create a snapshot. This is a nice trigger to use just before your lights turn OFF. This snapshot will create a scene and once created update the scene as per your instructions. Then use that scene in this automation and you will achieve what you are trying to do.
I not sure why you would like to do this but hay it is HA and you can do anything you like.
If you are not sure how to do this then maybe create a post (separate topic) and ask;
Q: How do I create an automation that will create a snapshot scene of my selected lights when my motion sensor goes OFF and only when the lights are ON?
There are heaps of community members that will help you do this.
Hope this helps you.
Blacky