Layer-4 (TCP/UDP) comes into picture only at the end points (sender/receiver).
layer-3 (IP) comes into picture per hop basis.
MTU is a property of the link, but fragmentation on the basis of this link property (MTU) always done at IP layer on a router (hop)
Now the link between each hop can be of different bandwidth, so at each hop it has to be decided how to forward the packet to the destination. As MTU is the maximum amount of data that can be pushed onto the link and if it it smaller than the size of packet to be send out, One has to fragment it into smaller chunks to accommodate onto the link.
As fragmentation and reassembly has many drawbacks like
1. small increase in CPU and memory overhead
2. more overhead per packet due to addition of fragment headers
3. If one fragment is lost sender has to transmit the entire packet
To solve above issues,
1. Path MTU Discovery can be used.
2. In Layer 4, TCP MSS-clamping can be used.