Theory of global thermoremanent magnetization of planetary lithospheres in dipole fields of internal origin