A sub-kiloparsec scale view of star formation in M31