Setting enum properties across multiple interdependent enum properties in a script
The problem is data_types_edges as well as the other data transfer attributes are python set objects and you are overwriting the entire set losing the previous values.

To add an element to a set, us the |= operator.

import bpy

data_transfer = bpy.context.object.modifiers["DataTransfer"]

data_transfer.data_types_edges |= {'SHARP_EDGE'}


It seems that the add() and update() function do not affect the modifier; so just use |= instead.