Listen to beforeChange and refresh event of the pager, in the event, get the selection indices of the grid (getSelection ) and save them along with page number.
[{ pageNo: ui.curPage, selections: [rowIndx, ..] }, ...]
When you receive data from the server in dataModel.getData callback, rebuild the selections with selection add method.