You could use an Action Hook ‘save_post
‘ to implement the requirement and this way categories will stay synced with your custom table and default tables.
Example :
function post_updated_sync_category( $post_id ) {
//Here you get postid of the post being updated
//You can put your code to update in custom table here
}
add_action( 'save_post', 'post_updated_sync_category' );
You can use this hook with custom post type as well, here is how you can implement this, see WordPress Codex