Taxing profits of companies that use AI probably. I really don't see other way, if AI starts replacing human work in large enough scale. In that situation, without welfare there will be soon nobody buying products and services, leading to an economic collapse.