Twisted bilayer graphene aligned with hexagonal boron nitride: Anomalous Hall effect and a lattice model