I admit I haven't given it a whole lot of thought, but, for the US at least, I see it happening slowly over time as a smooth extension of welfare, not as some piece of landmark legislation. As automation increases and jobs become more scarce, more people will need welfare assistance. With strained resources the government will look for solutions such as an automation tax for corporations, perhaps less defense/military spending, etc. Taken to it's logical conclusion, I think you end up with something like a basic universal income.