Epidemic Outbreaks in Networks with Equitable or Almost-Equitable Partitions