Implement a NumPy Transformer encoder block with self-attention, residual connections, normalization, and feed-forward layers.