UK and EU agree Brexit transition terms