Halo mass and assembly history exposed in the faint outskirts: the stellar and dark matter haloes of Illustris galaxies