TEE4EHR: Transformer Event Encoder for Better Representation Learning in Electronic Health Records