Building a Transformer from Scratch: A Step-by-Step Guide