No, you don't need to edit /lib/systemd/system/serial-getty@.service.
You should instead create a drop-in config fragment for
serial-getty@ttyS0.service like the following:
# /etc/systemd/system/serial-getty@ttyS0.service.d/autologin.conf
[Service]
ExecStart=
ExecStart=-/sbin/agetty -a root -o '-p -f -- \\u' --keep-baud 115200,38400,9600 %I $TERM
After that, apply the change on the running system with the following,
run as root:
systemctl daemon-reload
systemctl restart serial-getty@ttyS0.service