The mechanism of a formaldehyde-sensing transcriptional regulator