Local anisotropy in heated and cooled turbulent boundary layers