Multiwavelength observations of the transitional millisecond pulsar binary XSS J12270-4859