AI tools designed to generate child sex abuse material (CSAM) will be made illegal under "world leading" legislation, the government has announced.