Call backs and tensorboard

how to include callbacks in custom training loop and how to save model trained using custom loop ?