What have you done to make it work? This is really important! For you, not for me.
I would advise you to pick up the start and max records. That way if you click on select all you will be able to go through the items in your screen and select all of them, how to do this(?) the for each has the start and max records input, you just need to use that. And every time you enter a new page you will check if every item is selected or not that way you will be able to know if the select all is checked or not, again, with the start and max records variable.
If you have any problem, let me know. I will try to see if I can do that myself.
PS: I have shared a quick solution/logic, have a look, if it doesn't work, it is something like that you should do...
EDIT:
Which is working

the only thing missing here is to save on the database in the above action.
why?
because every time you are paginating, you are refreshing the database and everything you saved before is being erased by the refresh aggregate action.
So, just save the data and use my logic.
Let us know if that helped you!
Kind Regards,
Márcio Carvalho