Transfer-Matrix Methods meet Ehrhart Theory