The serialize function is used to convert the javascript transaction object into an RLP encoding of the transaction. The RLP encoding processes use a standard method to encodes structures/objects into bytes in a way that they can be sent and understood from one application/library to another - independent of the language they are using.
In this case - the transaction is created using ethereumjs-tx, likely passed to web3 or ethers, and then passed to a blockchain node. All three steps need to work with and understand the transaction, so having it in a format each library / application it is passing through can work with is important.
RLP Encoding
ethereum-js-tx serialization